Skip to content

Commit 547729e

Browse files
committed
Add unref to some long delays to avoid blocking shutdown
1 parent 55433a6 commit 547729e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/api/api-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class ApiModel {
175175

176176
// After 30s, don't stop activating, but report an error if we're not done yet
177177
let activationDone = false;
178-
delay(30000).then(() => {
178+
delay(30000, { unref: true }).then(() => {
179179
if (!activationDone) logError(`Timeout activating ${id}`)
180180
});
181181

src/interceptors/jvm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function testJavaBin(possibleJavaBin: string) {
119119
]
120120
),
121121
// Time out permanently after 30 seconds - this only runs once max anyway
122-
delay(30000).then(() => {
122+
delay(30000, { unref: true }).then(() => {
123123
throw new Error(`Java bin test for ${possibleJavaBin} timed out`);
124124
})
125125
]);

0 commit comments

Comments
 (0)