Skip to content

Commit

Permalink
fix: use unref() to allow graceful shutdown (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Mar 19, 2024
1 parent 7b34ce7 commit e122a52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion javascript/src/utils/polling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const CONNECTION_ERROR_RETRY_MAX_MS = 1000 * 60 * 10 // 10 minutes

function sleep(ms: number): Promise<void> {
return new Promise((resolve) => {
setTimeout(resolve, ms)
const timeout = setTimeout(resolve, ms)
timeout.unref()
})
}

Expand Down
3 changes: 2 additions & 1 deletion javascript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
/* Additional Checks */
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"lib": ["ESNext"]
},
"ts-node": {
// these options are overrides used only by ts-node
Expand Down

0 comments on commit e122a52

Please sign in to comment.