Skip to content

Commit

Permalink
Merge e083104 into a391486
Browse files Browse the repository at this point in the history
  • Loading branch information
timgit committed Aug 12, 2021
2 parents a391486 + e083104 commit d946e70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "pg-boss",
"version": "6.2.0",
"version": "6.2.1",
"description": "Queueing jobs in Node.js using PostgreSQL like a boss",
"main": "./src/index.js",
"engines": {
Expand Down
10 changes: 7 additions & 3 deletions src/manager.js
Expand Up @@ -173,11 +173,15 @@ class Manager extends EventEmitter {
const timeout = Math.max(1, seconds) * 1000
const reject = delay.reject(timeout, { value: new Error(`handler execution exceeded ${timeout}ms`) })

const result = await Promise.race([promise, reject])
let result

try {
reject.clear()
} catch {}
result = await Promise.race([promise, reject])
} finally {
try {
reject.clear()
} catch {}
}

return result
}
Expand Down

0 comments on commit d946e70

Please sign in to comment.