Skip to content

Commit

Permalink
Merge pull request permaweb#746 from permaweb/jfrain99/fix-mu-worker-…
Browse files Browse the repository at this point in the history
…try-catch

fix(mu): change try catch to .catch in mu worker
  • Loading branch information
jfrain99 authored May 29, 2024
2 parents 5b88ce9 + 6f028a2 commit 81a656a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions servers/mu/src/domain/clients/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,10 @@ function processResultsWith ({ dequeue, processResult, logger }) {
const result = dequeue()
if (result) {
logger(`Processing task of type ${result.type}`)
try {
processResult(result)
} catch (e) {
processResult(result).catch((e) => {
logger(`Result failed with error ${e}, will not recover`)
logger(e)
}
})
} else {
await new Promise(resolve => setTimeout(resolve, 100))
}
Expand Down

0 comments on commit 81a656a

Please sign in to comment.