File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ export async function runHTK(options: {
241241 // If we don't, we'll redownload the same update again every check.
242242 // We don't want to block it completely though, in case this server
243243 // stays open for a very long time.
244- return delay ( 1000 * 60 * 60 * 6 ) ;
244+ return delay ( 1000 * 60 * 60 * 6 , { unref : true } ) ;
245245 }
246246
247247 // Report any HTTP response errors cleanly & explicitly:
Original file line number Diff line number Diff line change 1- export function delay ( durationMs : number ) : Promise < void > {
2- return new Promise ( ( resolve ) => setTimeout ( resolve , durationMs ) ) ;
1+ export function delay ( durationMs : number , options : { unref ?: boolean } = { } ) : Promise < void > {
2+ return new Promise ( ( resolve ) => {
3+ const timer = setTimeout ( resolve , durationMs ) ;
4+ if ( options . unref ) timer . unref ( ) ;
5+ } ) ;
36}
47
58export async function waitUntil < T extends unknown > (
You can’t perform that action at this time.
0 commit comments