Skip to content

Commit b36c8c0

Browse files
committed
fix(push): support --wait-for-finish=0 as fire-and-forget
Skip the post-build tag-apply wait when --wait-for-finish=0 so the flag is truly fire-and-forget regardless of how fast the build completed. Document the 0 semantics in the flag help text. Also picks up stale doc regeneration from #1128 (--describe / --search wording).
1 parent a9faf00 commit b36c8c0

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

docs/reference.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ ARGUMENTS
6969
FLAGS
7070
-d, --body=<value> The request body (JSON string).
7171
Use "-" to read from stdin.
72-
--describe=<value> Describe an endpoint: print every HTTP
73-
method on a path, its summary, and path parameters.
74-
Accepts a path like "actor-runs/{runId}" or
75-
"/v2/actor-runs/{runId}".
72+
--describe=<value> Print a reference for an endpoint
73+
path: its HTTP methods, summary, and path parameters.
74+
Leading slashes and a version prefix in the path are
75+
optional. For example, "actor-runs/{runId}" and
76+
"/v2/actor-runs/{runId}" are both accepted.
7677
-H, --header=<value> Additional HTTP header(s). Pass a
7778
single "key:value" string, or a JSON object like
7879
'{"X-Foo": "bar", "X-Baz": "qux"}' to send multiple
@@ -85,9 +86,11 @@ FLAGS
8586
<options: GET|POST|PUT|PATCH|DELETE>
8687
-p, --params=<value> Query parameters as a JSON object,
8788
e.g. '{"limit": 1, "desc": true}'.
88-
-s, --search=<value> Filter --list-endpoints by a
89-
space-separated query. Each token must appear
90-
(case-insensitive) in method, path, or summary.
89+
-s, --search=<value> Filter results returned by
90+
--list-endpoints. The query is case-insensitive and split
91+
into tokens by spaces. For an endpoint to be returned,
92+
every token must appear in that endpoint's method, path,
93+
or summary.
9194
```
9295
9396
##### `apify telemetry`
@@ -742,7 +745,8 @@ FLAGS
742745
is taken from the '.actor/actor.json' file.
743746
-w, --wait-for-finish=<value> Seconds for waiting
744747
to build to finish, if no value passed, it waits
745-
forever.
748+
forever. Pass 0 to return as soon as the build is
749+
queued (fire-and-forget).
746750
```
747751
748752
##### `apify actors pull` / `apify pull`

src/commands/actors/push.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ export class ActorsPushCommand extends ApifyCommand<typeof ActorsPushCommand> {
9393
}),
9494
'wait-for-finish': Flags.string({
9595
char: 'w',
96-
description: 'Seconds for waiting to build to finish, if no value passed, it waits forever.',
96+
description:
97+
'Seconds for waiting to build to finish, if no value passed, it waits forever. Pass 0 to return as soon as the build is queued (fire-and-forget).',
9798
required: false,
9899
}),
99100
'open': Flags.boolean({
@@ -397,8 +398,9 @@ Skipping push. Use --force to override.`,
397398
// Platform updates `taggedBuilds[buildTag]` asynchronously after the
398399
// build finishes. Wait until the tag points at this build so callers
399400
// (including --json automation) that immediately
400-
// `actor.start({ build: buildTag })` don't race it.
401-
if (build.status === ACTOR_JOB_STATUSES.SUCCEEDED && buildTag) {
401+
// `actor.start({ build: buildTag })` don't race it. Skipped when
402+
// --wait-for-finish=0 (fire-and-forget).
403+
if (build.status === ACTOR_JOB_STATUSES.SUCCEEDED && buildTag && waitForFinishMillis !== 0) {
402404
run({ message: `Applying build tag "${buildTag}"...` });
403405
const tagDeadline = Date.now() + 5_000;
404406
let tagApplied = false;

0 commit comments

Comments
 (0)