File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,13 @@ async function waitForNotaryStatus(
328
328
username : string ,
329
329
password : string ,
330
330
) {
331
+ const starttime = Date . now ( ) ;
332
+
333
+ // 20 minutes
334
+ const msToWait = 1200000 ;
335
+
336
+ const pollIntervalSeconds = 15 ;
337
+
331
338
let errorCount = 0 ;
332
339
let notaryResult = undefined ;
333
340
while ( notaryResult == undefined ) {
@@ -352,7 +359,9 @@ async function waitForNotaryStatus(
352
359
errorCount = 0 ;
353
360
354
361
// Sleep for 15 seconds between checks
355
- await new Promise ( ( resolve ) => setTimeout ( resolve , 15 * 1000 ) ) ;
362
+ await new Promise ( ( resolve ) =>
363
+ setTimeout ( resolve , pollIntervalSeconds * 1000 )
364
+ ) ;
356
365
} else if ( status === "success" ) {
357
366
notaryResult = "Success" ;
358
367
} else {
@@ -365,6 +374,13 @@ async function waitForNotaryStatus(
365
374
errorCount = errorCount + 1 ;
366
375
}
367
376
}
377
+ if ( Date . now ( ) - starttime > msToWait ) {
378
+ throw new Error (
379
+ `Failed to Notarize - timed out after ${
380
+ msToWait / 1000
381
+ } seconds when awaiting notarization`,
382
+ ) ;
383
+ }
368
384
}
369
385
return notaryResult ;
370
386
}
You can’t perform that action at this time.
0 commit comments