Skip to content

Commit 9e26c3e

Browse files
committed
fix default pooling
1 parent b1d8b3e commit 9e26c3e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/commands/actors/push.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)