File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -383,13 +383,12 @@ Skipping push. Use --force to override.`,
383383
384384 // `outputJobLog` can return before the build is actually terminal (stream
385385 // ended early, timeout hit). Poll so the status branches below see the
386- // real outcome.
387- if ( waitForFinishMillis !== undefined ) {
388- const deadline = Date . now ( ) + waitForFinishMillis ;
389- while ( ! ACTOR_JOB_TERMINAL_STATUSES . includes ( build . status as never ) && Date . now ( ) < deadline ) {
390- await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
391- build = ( await apifyClient . build ( build . id ) . get ( ) ) ! ;
392- }
386+ // real outcome. With no --wait-for-finish, the flag documents "waits
387+ // forever", so poll without a deadline.
388+ const deadline = waitForFinishMillis === undefined ? Infinity : Date . now ( ) + waitForFinishMillis ;
389+ while ( ! ACTOR_JOB_TERMINAL_STATUSES . includes ( build . status as never ) && Date . now ( ) < deadline ) {
390+ await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
391+ build = ( await apifyClient . build ( build . id ) . get ( ) ) ! ;
393392 }
394393
395394 if ( this . flags . json ) {
You can’t perform that action at this time.
0 commit comments