Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra done() callback #3634

Merged
merged 4 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion creator-node/src/services/sync/syncImmediateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class SyncImmediateQueue {
removeOnFail: SYNC_QUEUE_HISTORY
},
settings: {
lockDuration: LOCK_DURATION
lockDuration: LOCK_DURATION,
// We never want to re-process stalled jobs
maxStalledCount: 0
}
})

Expand Down
12 changes: 8 additions & 4 deletions creator-node/src/services/sync/syncQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class SyncQueue {
removeOnFail: SYNC_QUEUE_HISTORY
},
settings: {
lockDuration: LOCK_DURATION
lockDuration: LOCK_DURATION,
// We never want to re-process stalled jobs
maxStalledCount: 0
}
})

Expand All @@ -46,11 +48,12 @@ class SyncQueue {
const jobProcessorConcurrency = this.nodeConfig.get(
'syncQueueMaxConcurrency'
)
this.queue.process(jobProcessorConcurrency, async (job, done) => {
this.queue.process(jobProcessorConcurrency, async (job) => {
const { walletPublicKeys, creatorNodeEndpoint, forceResync } = job.data

let result = {}
try {
await secondarySyncFromPrimary(
result = await secondarySyncFromPrimary(
this.serviceRegistry,
walletPublicKeys,
creatorNodeEndpoint,
Expand All @@ -62,9 +65,10 @@ class SyncQueue {
`secondarySyncFromPrimary failure for wallets ${walletPublicKeys} against ${creatorNodeEndpoint}`,
e.message
)
result = { error: e.message }
}

done()
return result
})
}

Expand Down