Minor bug fixes & build job (#89)

This commit is contained in:
Chris Anderson 2023-03-21 18:27:14 -05:00 committed by GitHub
parent 152fe8d430
commit b8d246592d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 3 deletions

View file

@ -76,3 +76,24 @@ jobs:
BASE_URL: https://parcelvoy.com
QUEUE_DRIVER: memory
STORAGE_DRIVER: s3
build:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Node Install
run: |
npm install
- name: Build
run: |
npm run build

View file

@ -17,7 +17,7 @@ export default class CampaignSendJob extends Job {
await campaignSendReadyQuery(campaign.id)
.stream(async function(stream) {
for await (const { user_id, ...campaign } of stream) {
for await (const { user_id } of stream) {
await sendCampaign(campaign, user_id)
}
})

View file

@ -99,7 +99,8 @@ class SchedulerLock {
// Clean up any oddball pending jobs that are missed
// Randomly run this job to reduce chance of deadlocks
if (randomInt() < 10) {
await JobLock.delete(qb => qb.where('expiration', '<=', new Date()))
await sleep(randomInt(5, 20))
await JobLock.delete(qb => qb.where('expiration', '<=', new Date()).orderBy('id'))
}
return acquired

View file

@ -76,7 +76,6 @@ export function EntityIdPicker<T extends { id: number }>({
<span className={clsx('ui-text-field', size ?? 'regular')} style={{ flexGrow: 1 }}>
<Combobox.Input
displayValue={(value: T) => value && displayValue(value)}
disabled={Boolean(value && !entity)}
onChange={e => setQuery(e.target.value)}
onBlur={onBlur}
ref={(input: HTMLInputElement) => {