@adonis-agora/durable 1.0.0-rc.19 → 1.0.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/commands/health.d.ts +12 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +34 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/lifecycle_republish.d.ts +8 -9
- package/dist/commands/lifecycle_republish.d.ts.map +1 -1
- package/dist/commands/lifecycle_republish.js +29 -16
- package/dist/commands/lifecycle_republish.js.map +1 -1
- package/dist/commands/main.d.ts +24 -5
- package/dist/commands/main.d.ts.map +1 -1
- package/dist/commands/main.js +50 -7
- package/dist/commands/main.js.map +1 -1
- package/dist/commands/runs.d.ts +9 -16
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +60 -49
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/runs_bulk.d.ts +17 -0
- package/dist/commands/runs_bulk.d.ts.map +1 -0
- package/dist/commands/runs_bulk.js +74 -0
- package/dist/commands/runs_bulk.js.map +1 -0
- package/dist/commands/runs_cancel.d.ts +15 -0
- package/dist/commands/runs_cancel.d.ts.map +1 -0
- package/dist/commands/runs_cancel.js +39 -0
- package/dist/commands/runs_cancel.js.map +1 -0
- package/dist/commands/runs_continue.d.ts +12 -0
- package/dist/commands/runs_continue.d.ts.map +1 -0
- package/dist/commands/runs_continue.js +28 -0
- package/dist/commands/runs_continue.js.map +1 -0
- package/dist/commands/runs_event.d.ts +13 -0
- package/dist/commands/runs_event.d.ts.map +1 -0
- package/dist/commands/runs_event.js +28 -0
- package/dist/commands/runs_event.js.map +1 -0
- package/dist/commands/runs_fan.d.ts +16 -0
- package/dist/commands/runs_fan.d.ts.map +1 -0
- package/dist/commands/runs_fan.js +58 -0
- package/dist/commands/runs_fan.js.map +1 -0
- package/dist/commands/runs_redispatch.d.ts +14 -0
- package/dist/commands/runs_redispatch.d.ts.map +1 -0
- package/dist/commands/runs_redispatch.js +35 -0
- package/dist/commands/runs_redispatch.js.map +1 -0
- package/dist/commands/runs_replay.d.ts +14 -0
- package/dist/commands/runs_replay.d.ts.map +1 -0
- package/dist/commands/runs_replay.js +38 -0
- package/dist/commands/runs_replay.js.map +1 -0
- package/dist/commands/runs_retry.d.ts +13 -0
- package/dist/commands/runs_retry.d.ts.map +1 -0
- package/dist/commands/runs_retry.js +29 -0
- package/dist/commands/runs_retry.js.map +1 -0
- package/dist/commands/runs_show.d.ts +14 -0
- package/dist/commands/runs_show.d.ts.map +1 -0
- package/dist/commands/runs_show.js +96 -0
- package/dist/commands/runs_show.js.map +1 -0
- package/dist/commands/runs_signal.d.ts +17 -0
- package/dist/commands/runs_signal.d.ts.map +1 -0
- package/dist/commands/runs_signal.js +49 -0
- package/dist/commands/runs_signal.js.map +1 -0
- package/dist/commands/runs_update.d.ts +15 -0
- package/dist/commands/runs_update.d.ts.map +1 -0
- package/dist/commands/runs_update.js +39 -0
- package/dist/commands/runs_update.js.map +1 -0
- package/dist/commands/runs_values.d.ts +15 -0
- package/dist/commands/runs_values.d.ts.map +1 -0
- package/dist/commands/runs_values.js +45 -0
- package/dist/commands/runs_values.js.map +1 -0
- package/dist/commands/schedules.d.ts +18 -0
- package/dist/commands/schedules.d.ts.map +1 -0
- package/dist/commands/schedules.js +70 -0
- package/dist/commands/schedules.js.map +1 -0
- package/dist/commands/schedules_pause.d.ts +16 -0
- package/dist/commands/schedules_pause.d.ts.map +1 -0
- package/dist/commands/schedules_pause.js +40 -0
- package/dist/commands/schedules_pause.js.map +1 -0
- package/dist/commands/schedules_resume.d.ts +8 -0
- package/dist/commands/schedules_resume.d.ts.map +1 -0
- package/dist/commands/schedules_resume.js +8 -0
- package/dist/commands/schedules_resume.js.map +1 -0
- package/dist/commands/schedules_trigger.d.ts +13 -0
- package/dist/commands/schedules_trigger.d.ts.map +1 -0
- package/dist/commands/schedules_trigger.js +32 -0
- package/dist/commands/schedules_trigger.js.map +1 -0
- package/dist/commands/tasks_complete.d.ts +15 -0
- package/dist/commands/tasks_complete.d.ts.map +1 -0
- package/dist/commands/tasks_complete.js +41 -0
- package/dist/commands/tasks_complete.js.map +1 -0
- package/dist/commands/tasks_fail.d.ts +16 -0
- package/dist/commands/tasks_fail.d.ts.map +1 -0
- package/dist/commands/tasks_fail.js +47 -0
- package/dist/commands/tasks_fail.js.map +1 -0
- package/dist/commands/workers.d.ts +11 -0
- package/dist/commands/workers.d.ts.map +1 -0
- package/dist/commands/workers.js +35 -0
- package/dist/commands/workers.js.map +1 -0
- package/dist/commands/workflows_lifecycle.d.ts +12 -0
- package/dist/commands/workflows_lifecycle.d.ts.map +1 -0
- package/dist/commands/workflows_lifecycle.js +37 -0
- package/dist/commands/workflows_lifecycle.js.map +1 -0
- package/dist/configure.d.ts +1 -1
- package/dist/configure.js +1 -1
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +2 -18
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/src/commands/console_command.d.ts +82 -0
- package/dist/src/commands/console_command.d.ts.map +1 -0
- package/dist/src/commands/console_command.js +238 -0
- package/dist/src/commands/console_command.js.map +1 -0
- package/dist/src/commands/runs.js +1 -1
- package/dist/src/commands/runs.js.map +1 -1
- package/dist/src/dashboard/audit.d.ts +14 -0
- package/dist/src/dashboard/audit.d.ts.map +1 -0
- package/dist/src/dashboard/audit.js +36 -0
- package/dist/src/dashboard/audit.js.map +1 -0
- package/dist/src/dashboard/define_config.d.ts +7 -3
- package/dist/src/dashboard/define_config.d.ts.map +1 -1
- package/dist/src/dashboard/define_config.js.map +1 -1
- package/dist/src/dashboard/dev_tools.d.ts.map +1 -1
- package/dist/src/dashboard/dev_tools.js +4 -11
- package/dist/src/dashboard/dev_tools.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +17 -0
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +14 -0
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +1 -1
- package/dist/src/dashboard/index.js +1 -1
- package/dist/src/engine.d.ts +6 -0
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +16 -3
- package/dist/src/engine.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/durable-reliability/SKILL.md +11 -5
- package/dist/commands/retry.d.ts +0 -16
- package/dist/commands/retry.d.ts.map +0 -1
- package/dist/commands/retry.js +0 -34
- package/dist/commands/retry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @adonis-agora/durable
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.20
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#522](https://github.com/DavideCarvalho/adonis-agora-durable/pull/522) [`74d8fed`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/74d8fed9ebf899abd568331d73471eafcba0a8a0) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Everything the durable console does is now an ace command, running the console's own handlers (same validation, tenant scope, redaction and audit). New: `durable:runs:show`, `durable:runs:fan`, `durable:runs:values`, `durable:runs:event`, `durable:runs:replay`, `durable:runs:redispatch`, `durable:runs:cancel`, `durable:runs:continue`, `durable:runs:signal`, `durable:runs:update`, `durable:runs:bulk`, `durable:tasks:complete`, `durable:tasks:fail`, `durable:schedules`, `durable:schedules:pause`, `durable:schedules:resume`, `durable:schedules:trigger`, `durable:workers`, `durable:health` and `durable:workflows:lifecycle`. Lists and shows take `--json`; every command takes `--tenant` when tenancy is on; cancel, redispatch, task fail and bulk ask for confirmation unless `--force` (and refuse without a terminal), bulk has `--dry-run`. Actions are recorded through the console's `audit` hook with the actor `cli:<os user>` and the method `CLI`.
|
|
8
|
+
|
|
9
|
+
Breaking: `durable:retry` is renamed `durable:runs:retry` (no alias). `durable:runs` reads through the console's `GET /runs`: it takes the console's filters (`--status` and `--workflow` accept several values, plus `--tag`, `--namespace`, `--origin`, `--attr`, `--created-after`, `--created-before`) and pages with `--page` / `--size` instead of `--limit`; bare `--stale` now parses. `durable:lifecycle:republish --run` goes through the console's republish route, so an unsettled run is refused. New `engine.flushControl()` waits for schedule pauses to reach the control plane.
|
|
10
|
+
|
|
3
11
|
## 1.0.0-rc.19
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:health` — per worker group the queue backlog and live workers (`stalled` is a
|
|
4
|
+
* backlog with no worker), and how many runs are pending, dead or blocked: the same report as the
|
|
5
|
+
* `durable_get_health` developer tool. Exit code 1 when a group is stalled.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableHealth extends DurableConsoleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
protected perform(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../commands/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAe,MAAM,oCAAoC,CAAC;AAGxF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,qBAAqB;IAC9D,OAAgB,WAAW,SAAoB;IAC/C,OAAgB,WAAW,SAAkE;IAE7F,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CA0BvC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DurableConsoleCommand, renderTable } from '../src/commands/console_command.js';
|
|
2
|
+
import { fleetHealth } from '../src/dashboard/handlers.js';
|
|
3
|
+
/**
|
|
4
|
+
* `node ace durable:health` — per worker group the queue backlog and live workers (`stalled` is a
|
|
5
|
+
* backlog with no worker), and how many runs are pending, dead or blocked: the same report as the
|
|
6
|
+
* `durable_get_health` developer tool. Exit code 1 when a group is stalled.
|
|
7
|
+
*/
|
|
8
|
+
export default class DurableHealth extends DurableConsoleCommand {
|
|
9
|
+
static commandName = 'durable:health';
|
|
10
|
+
static description = 'Fleet health: backlog and live workers per group, run counts';
|
|
11
|
+
async perform() {
|
|
12
|
+
const report = await fleetHealth(await this.deps());
|
|
13
|
+
const stalled = report.groups.filter((g) => g.stalled);
|
|
14
|
+
if (stalled.length > 0)
|
|
15
|
+
this.exitCode = 1;
|
|
16
|
+
if (this.json)
|
|
17
|
+
return this.printJson(report);
|
|
18
|
+
this.logger.log(report.groups.length === 0
|
|
19
|
+
? 'No worker groups.'
|
|
20
|
+
: renderTable(['GROUP', 'DEPTH', 'LIVE WORKERS', 'STALLED'], report.groups.map((g) => [
|
|
21
|
+
g.group,
|
|
22
|
+
String(g.depth),
|
|
23
|
+
String(g.liveWorkers),
|
|
24
|
+
g.stalled ? 'yes' : 'no',
|
|
25
|
+
])));
|
|
26
|
+
if (report.runs) {
|
|
27
|
+
this.logger.log(`runs: ${report.runs.pending} pending, ${report.runs.dead} dead, ${report.runs.blocked} blocked`);
|
|
28
|
+
}
|
|
29
|
+
for (const g of stalled) {
|
|
30
|
+
this.logger.warning(`group ${g.group} is stalled: ${g.depth} queued, no live worker`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../commands/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,qBAA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E,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,gBAAgB,CAAC,CAAC,KAAK,yBAAyB,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { CommandOptions } from '@adonisjs/core/types/ace';
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
3
2
|
/**
|
|
4
3
|
* `node ace durable:lifecycle:republish --run <id>` or `--workflow <name> [--since] [--until]` — publish
|
|
5
|
-
* settled runs' lifecycle events again
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* settled runs' lifecycle events again. `--run` goes through the console's
|
|
5
|
+
* `POST /runs/:id/republish-lifecycle`; `--workflow` through the same port's `republishLifecycle`.
|
|
6
|
+
* Backfills a subscriber registered after the runs settled, or retries one that failed; a subscriber
|
|
7
|
+
* run that already exists is not started again. Subscribers this app cannot deliver to are marked
|
|
8
|
+
* owed, for the lifecycle sweep of an instance that can.
|
|
9
9
|
*/
|
|
10
|
-
export default class DurableLifecycleRepublish extends
|
|
10
|
+
export default class DurableLifecycleRepublish extends DurableConsoleCommand {
|
|
11
11
|
static commandName: string;
|
|
12
12
|
static description: string;
|
|
13
|
-
static options: CommandOptions;
|
|
14
13
|
runId?: string;
|
|
15
14
|
workflow?: string;
|
|
16
15
|
since?: string;
|
|
@@ -18,6 +17,6 @@ export default class DurableLifecycleRepublish extends BaseCommand {
|
|
|
18
17
|
kind?: string;
|
|
19
18
|
limit?: number;
|
|
20
19
|
subscriber?: string;
|
|
21
|
-
|
|
20
|
+
protected perform(): Promise<void>;
|
|
22
21
|
}
|
|
23
22
|
//# sourceMappingURL=lifecycle_republish.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle_republish.d.ts","sourceRoot":"","sources":["../../commands/lifecycle_republish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lifecycle_republish.d.ts","sourceRoot":"","sources":["../../commands/lifecycle_republish.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAKvF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,qBAAqB;IAC1E,OAAgB,WAAW,SAAiC;IAC5D,OAAgB,WAAW,SAAkD;IAGrE,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,UAAU,CAAC,EAAE,MAAM,CAAC;IAE5B,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAgCvC;CACF"}
|
|
@@ -4,21 +4,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { CliRefusal, DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
8
9
|
import { renderRepublishResult, republishLifecycleTarget } from '../src/commands/runs.js';
|
|
9
|
-
import {
|
|
10
|
+
import { republishLifecycleRun } from '../src/dashboard/handlers.js';
|
|
10
11
|
/**
|
|
11
12
|
* `node ace durable:lifecycle:republish --run <id>` or `--workflow <name> [--since] [--until]` — publish
|
|
12
|
-
* settled runs' lifecycle events again
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* settled runs' lifecycle events again. `--run` goes through the console's
|
|
14
|
+
* `POST /runs/:id/republish-lifecycle`; `--workflow` through the same port's `republishLifecycle`.
|
|
15
|
+
* Backfills a subscriber registered after the runs settled, or retries one that failed; a subscriber
|
|
16
|
+
* run that already exists is not started again. Subscribers this app cannot deliver to are marked
|
|
17
|
+
* owed, for the lifecycle sweep of an instance that can.
|
|
16
18
|
*/
|
|
17
|
-
export default class DurableLifecycleRepublish extends
|
|
19
|
+
export default class DurableLifecycleRepublish extends DurableConsoleCommand {
|
|
18
20
|
static commandName = 'durable:lifecycle:republish';
|
|
19
21
|
static description = "Publish settled runs' lifecycle events again";
|
|
20
|
-
|
|
21
|
-
async run() {
|
|
22
|
+
async perform() {
|
|
22
23
|
const target = republishLifecycleTarget({
|
|
23
24
|
run: this.runId,
|
|
24
25
|
workflow: this.workflow,
|
|
@@ -28,16 +29,28 @@ export default class DurableLifecycleRepublish extends BaseCommand {
|
|
|
28
29
|
limit: this.limit,
|
|
29
30
|
subscriber: this.subscriber,
|
|
30
31
|
});
|
|
31
|
-
if ('error' in target)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if ('error' in target)
|
|
33
|
+
throw new CliRefusal(target.error);
|
|
34
|
+
const deps = await this.deps();
|
|
35
|
+
this.audit('runId' in target ? target.runId : `workflow ${target.workflow}`);
|
|
36
|
+
let result;
|
|
37
|
+
if ('runId' in target) {
|
|
38
|
+
({ result } = await this.call(republishLifecycleRun, {
|
|
39
|
+
params: { id: target.runId },
|
|
40
|
+
body: target.subscriber ? { subscriber: target.subscriber } : {},
|
|
41
|
+
}, deps));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (!deps.engine.republishLifecycle) {
|
|
45
|
+
throw new CliRefusal('republish is unavailable on this topology');
|
|
46
|
+
}
|
|
47
|
+
result = await deps.engine.republishLifecycle(target);
|
|
35
48
|
}
|
|
36
|
-
const engine = await this.app.container.make(WorkflowEngine);
|
|
37
|
-
const result = await engine.republishLifecycle(target);
|
|
38
|
-
this.logger.info(renderRepublishResult(result));
|
|
39
49
|
if (result.failed.length > 0)
|
|
40
50
|
this.exitCode = 1;
|
|
51
|
+
if (this.json)
|
|
52
|
+
return this.printJson({ result });
|
|
53
|
+
this.logger.info(renderRepublishResult(result));
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
56
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle_republish.js","sourceRoot":"","sources":["../../commands/lifecycle_republish.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"lifecycle_republish.js","sourceRoot":"","sources":["../../commands/lifecycle_republish.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAGrE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,qBAAqB;IAC1E,MAAM,CAAU,WAAW,GAAG,6BAA6B,CAAC;IAC5D,MAAM,CAAU,WAAW,GAAG,8CAA8C,CAAC;IAuBnE,KAAK,CAAC,OAAO;QACrB,MAAM,MAAM,GAAG,wBAAwB,CAAC;YACtC,GAAG,EAAE,IAAI,CAAC,KAAK;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC;QACH,IAAI,OAAO,IAAI,MAAM;YAAE,MAAM,IAAI,UA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AAE,CAAC;wDAC9C;AAGf;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;2DAC1C;AAGlB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;wDACvE;AAGf;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;wDACxE;AAGf;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;uDACnE;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;wDACjE;AAGf;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;6DACpC"}
|
package/dist/commands/main.d.ts
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
import { ListLoader } from '@adonisjs/core/ace';
|
|
2
2
|
import AgoraDoctor from './agora_doctor.js';
|
|
3
3
|
import DurableWorker from './durable_worker.js';
|
|
4
|
+
import DurableExport from './export_run.js';
|
|
5
|
+
import DurableHealth from './health.js';
|
|
4
6
|
import DurableLifecycleRepublish from './lifecycle_republish.js';
|
|
5
7
|
import MakeWorkflow from './make_workflow.js';
|
|
6
|
-
import DurableRetry from './retry.js';
|
|
7
8
|
import DurableRuns from './runs.js';
|
|
9
|
+
import DurableRunsBulk from './runs_bulk.js';
|
|
10
|
+
import DurableRunsCancel from './runs_cancel.js';
|
|
11
|
+
import DurableRunsContinue from './runs_continue.js';
|
|
12
|
+
import DurableRunsEvent from './runs_event.js';
|
|
13
|
+
import DurableRunsFan from './runs_fan.js';
|
|
14
|
+
import DurableRunsRedispatch from './runs_redispatch.js';
|
|
15
|
+
import DurableRunsReplay from './runs_replay.js';
|
|
16
|
+
import DurableRunsRetry from './runs_retry.js';
|
|
17
|
+
import DurableRunsShow from './runs_show.js';
|
|
18
|
+
import DurableRunsSignal from './runs_signal.js';
|
|
19
|
+
import DurableRunsValues from './runs_values.js';
|
|
20
|
+
import DurableSchedules from './schedules.js';
|
|
21
|
+
import DurableSchedulesPause from './schedules_pause.js';
|
|
22
|
+
import DurableSchedulesTrigger from './schedules_trigger.js';
|
|
8
23
|
import DurableWork from './work.js';
|
|
24
|
+
import DurableWorkers from './workers.js';
|
|
9
25
|
/**
|
|
10
26
|
* The commands barrel for `@adonis-agora/durable`. Registered in an app's `adonisrc` via
|
|
11
27
|
* `rcFile.addCommand('@adonis-agora/durable/commands')` (done by this package's `configure`). The ace
|
|
12
28
|
* kernel imports this module and treats it as a commands loader: a {@link ListLoader} over the durable
|
|
13
|
-
* commands (`durable:work`, `durable:worker
|
|
14
|
-
*
|
|
29
|
+
* commands — the workers (`durable:work`, `durable:worker`), the operator commands that mirror the
|
|
30
|
+
* console (`durable:runs*`, `durable:tasks:*`, `durable:schedules*`, `durable:workers`,
|
|
31
|
+
* `durable:health`, `durable:workflows:lifecycle`, `durable:lifecycle:republish`), `durable:export`,
|
|
32
|
+
* `make:workflow`, `agora:doctor` and `durable:doctor`.
|
|
15
33
|
*/
|
|
16
|
-
declare const
|
|
34
|
+
export declare const DURABLE_COMMANDS: (typeof AgoraDoctor | typeof DurableWorker | typeof DurableExport | typeof DurableHealth | typeof DurableLifecycleRepublish | typeof MakeWorkflow | typeof DurableRuns | typeof DurableRunsBulk | typeof DurableRunsCancel | typeof DurableRunsContinue | typeof DurableRunsEvent | typeof DurableRunsFan | typeof DurableRunsRedispatch | typeof DurableRunsReplay | typeof DurableRunsRetry | typeof DurableRunsShow | typeof DurableRunsSignal | typeof DurableRunsValues | typeof DurableSchedules | typeof DurableSchedulesPause | typeof DurableSchedulesTrigger | typeof DurableWork | typeof DurableWorkers)[];
|
|
35
|
+
declare const loader: ListLoader<typeof AgoraDoctor | typeof DurableWorker | typeof DurableExport | typeof DurableHealth | typeof DurableLifecycleRepublish | typeof MakeWorkflow | typeof DurableRuns | typeof DurableRunsBulk | typeof DurableRunsCancel | typeof DurableRunsContinue | typeof DurableRunsEvent | typeof DurableRunsFan | typeof DurableRunsRedispatch | typeof DurableRunsReplay | typeof DurableRunsRetry | typeof DurableRunsShow | typeof DurableRunsSignal | typeof DurableRunsValues | typeof DurableSchedules | typeof DurableSchedulesPause | typeof DurableSchedulesTrigger | typeof DurableWork | typeof DurableWorkers>;
|
|
17
36
|
export declare const getMetaData: () => Promise<import("@adonisjs/core/types/ace").CommandMetaData[]>;
|
|
18
|
-
export declare const getCommand: (metaData: import("@adonisjs/core/types/ace").CommandMetaData) => Promise<typeof AgoraDoctor | typeof DurableWorker | typeof DurableLifecycleRepublish | typeof MakeWorkflow | typeof
|
|
37
|
+
export declare const getCommand: (metaData: import("@adonisjs/core/types/ace").CommandMetaData) => Promise<typeof AgoraDoctor | typeof DurableWorker | typeof DurableExport | typeof DurableHealth | typeof DurableLifecycleRepublish | typeof MakeWorkflow | typeof DurableRuns | typeof DurableRunsBulk | typeof DurableRunsCancel | typeof DurableRunsContinue | typeof DurableRunsEvent | typeof DurableRunsFan | typeof DurableRunsRedispatch | typeof DurableRunsReplay | typeof DurableRunsRetry | typeof DurableRunsShow | typeof DurableRunsSignal | typeof DurableRunsValues | typeof DurableSchedules | typeof DurableSchedulesPause | typeof DurableSchedulesTrigger | typeof DurableWork | typeof DurableWorkers | null>;
|
|
19
38
|
export default loader;
|
|
20
39
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAE5C,OAAO,aAAa,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB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
|
|
4
4
|
import DurableWorker from './durable_worker.js';
|
|
5
5
|
import DurableExport from './export_run.js';
|
|
6
|
+
import DurableHealth from './health.js';
|
|
6
7
|
import DurableLifecycleRepublish from './lifecycle_republish.js';
|
|
7
8
|
import MakeWorkflow from './make_workflow.js';
|
|
8
|
-
import DurableRetry from './retry.js';
|
|
9
9
|
import DurableRuns from './runs.js';
|
|
10
|
+
import DurableRunsBulk from './runs_bulk.js';
|
|
11
|
+
import DurableRunsCancel from './runs_cancel.js';
|
|
12
|
+
import DurableRunsContinue from './runs_continue.js';
|
|
13
|
+
import DurableRunsEvent from './runs_event.js';
|
|
14
|
+
import DurableRunsFan from './runs_fan.js';
|
|
15
|
+
import DurableRunsRedispatch from './runs_redispatch.js';
|
|
16
|
+
import DurableRunsReplay from './runs_replay.js';
|
|
17
|
+
import DurableRunsRetry from './runs_retry.js';
|
|
18
|
+
import DurableRunsShow from './runs_show.js';
|
|
19
|
+
import DurableRunsSignal from './runs_signal.js';
|
|
20
|
+
import DurableRunsUpdate from './runs_update.js';
|
|
21
|
+
import DurableRunsValues from './runs_values.js';
|
|
22
|
+
import DurableSchedules from './schedules.js';
|
|
23
|
+
import DurableSchedulesPause from './schedules_pause.js';
|
|
24
|
+
import DurableSchedulesResume from './schedules_resume.js';
|
|
25
|
+
import DurableSchedulesTrigger from './schedules_trigger.js';
|
|
26
|
+
import DurableTasksComplete from './tasks_complete.js';
|
|
27
|
+
import DurableTasksFail from './tasks_fail.js';
|
|
10
28
|
import DurableWork from './work.js';
|
|
29
|
+
import DurableWorkers from './workers.js';
|
|
30
|
+
import DurableWorkflowsLifecycle from './workflows_lifecycle.js';
|
|
11
31
|
/**
|
|
12
32
|
* The commands barrel for `@adonis-agora/durable`. Registered in an app's `adonisrc` via
|
|
13
33
|
* `rcFile.addCommand('@adonis-agora/durable/commands')` (done by this package's `configure`). The ace
|
|
14
34
|
* kernel imports this module and treats it as a commands loader: a {@link ListLoader} over the durable
|
|
15
|
-
* commands (`durable:work`, `durable:worker
|
|
16
|
-
*
|
|
35
|
+
* commands — the workers (`durable:work`, `durable:worker`), the operator commands that mirror the
|
|
36
|
+
* console (`durable:runs*`, `durable:tasks:*`, `durable:schedules*`, `durable:workers`,
|
|
37
|
+
* `durable:health`, `durable:workflows:lifecycle`, `durable:lifecycle:republish`), `durable:export`,
|
|
38
|
+
* `make:workflow`, `agora:doctor` and `durable:doctor`.
|
|
17
39
|
*/
|
|
18
|
-
const
|
|
40
|
+
export const DURABLE_COMMANDS = [
|
|
19
41
|
DurableWork,
|
|
20
42
|
DurableWorker,
|
|
21
43
|
DurableRuns,
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
DurableRunsShow,
|
|
45
|
+
DurableRunsFan,
|
|
46
|
+
DurableRunsValues,
|
|
47
|
+
DurableRunsEvent,
|
|
48
|
+
DurableRunsRetry,
|
|
49
|
+
DurableRunsReplay,
|
|
50
|
+
DurableRunsRedispatch,
|
|
51
|
+
DurableRunsCancel,
|
|
52
|
+
DurableRunsContinue,
|
|
53
|
+
DurableRunsSignal,
|
|
54
|
+
DurableRunsUpdate,
|
|
55
|
+
DurableRunsBulk,
|
|
56
|
+
DurableTasksComplete,
|
|
57
|
+
DurableTasksFail,
|
|
58
|
+
DurableSchedules,
|
|
59
|
+
DurableSchedulesPause,
|
|
60
|
+
DurableSchedulesResume,
|
|
61
|
+
DurableSchedulesTrigger,
|
|
62
|
+
DurableWorkers,
|
|
63
|
+
DurableHealth,
|
|
64
|
+
DurableWorkflowsLifecycle,
|
|
24
65
|
DurableLifecycleRepublish,
|
|
66
|
+
DurableExport,
|
|
25
67
|
MakeWorkflow,
|
|
26
68
|
AgoraDoctor,
|
|
27
69
|
DurableDoctor,
|
|
28
|
-
]
|
|
70
|
+
];
|
|
71
|
+
const loader = new ListLoader(DURABLE_COMMANDS);
|
|
29
72
|
export const getMetaData = loader.getMetaData.bind(loader);
|
|
30
73
|
export const getCommand = loader.getCommand.bind(loader);
|
|
31
74
|
export default loader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,yBAAyB,MAAM,0BAA0B,CAAC;AACjE,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,yBAAyB,MAAM,0BAA0B,CAAC;AACjE,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,eAAe,MAAM,gBAAgB,CAAC;AAC7C,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAAO,mBAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,cAAc,MAAM,eAAe,CAAC;AAC3C,OAAO,qBAAqB,MAAM,sBAAsB,CAAC;AACzD,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,eAAe,MAAM,gBAAgB,CAAC;AAC7C,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAA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2
|
-
import type { CommandOptions } from '@adonisjs/core/types/ace';
|
|
1
|
+
import { RunFilterCommand } from '../src/commands/console_command.js';
|
|
3
2
|
/**
|
|
4
|
-
* `node ace durable:runs` — list
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Every row also carries liveness signals (UPDATED age, RECOVERY attempts, PENDING remote-step age) —
|
|
9
|
-
* `suspended` alone can't tell a run mid-step apart from one whose dispatch was lost (see
|
|
10
|
-
* `src/commands/runs.ts`'s module doc). `--stale` narrows the listing to exactly the runs that look
|
|
11
|
-
* stranded by that signal.
|
|
3
|
+
* `node ace durable:runs` — list runs, newest first, through the console's `GET /runs` handler (same
|
|
4
|
+
* filters, paging, tenant scope and redaction). Every row carries liveness signals (UPDATED age,
|
|
5
|
+
* RECOVERY attempts, PENDING remote-step age); `--stale` narrows the page to the runs that look
|
|
6
|
+
* stranded by them.
|
|
12
7
|
*/
|
|
13
|
-
export default class DurableRuns extends
|
|
8
|
+
export default class DurableRuns extends RunFilterCommand {
|
|
14
9
|
static commandName: string;
|
|
15
10
|
static description: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
workflow?: string;
|
|
19
|
-
limit: number;
|
|
11
|
+
page?: number;
|
|
12
|
+
size?: number;
|
|
20
13
|
stale?: string;
|
|
21
|
-
|
|
14
|
+
protected perform(): Promise<void>;
|
|
22
15
|
}
|
|
23
16
|
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../commands/runs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../commands/runs.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAsBlF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,gBAAgB;IACvD,OAAgB,WAAW,SAAkB;IAC7C,OAAgB,WAAW,SAA2D;IAG9E,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAQd,KAAK,CAAC,EAAE,MAAM,CAAC;IAEvB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDvC;CACF"}
|
package/dist/commands/runs.js
CHANGED
|
@@ -4,67 +4,78 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { pageFooter, RunFilterCommand } from '../src/commands/console_command.js';
|
|
9
|
+
import { attachLiveness, DEFAULT_STALE_MS, filterStale, parseDurationMs, renderRunsTable, staleHint, } from '../src/commands/runs.js';
|
|
10
|
+
import { listRuns } from '../src/dashboard/handlers.js';
|
|
10
11
|
/**
|
|
11
|
-
* `node ace durable:runs` — list
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* Every row also carries liveness signals (UPDATED age, RECOVERY attempts, PENDING remote-step age) —
|
|
16
|
-
* `suspended` alone can't tell a run mid-step apart from one whose dispatch was lost (see
|
|
17
|
-
* `src/commands/runs.ts`'s module doc). `--stale` narrows the listing to exactly the runs that look
|
|
18
|
-
* stranded by that signal.
|
|
12
|
+
* `node ace durable:runs` — list runs, newest first, through the console's `GET /runs` handler (same
|
|
13
|
+
* filters, paging, tenant scope and redaction). Every row carries liveness signals (UPDATED age,
|
|
14
|
+
* RECOVERY attempts, PENDING remote-step age); `--stale` narrows the page to the runs that look
|
|
15
|
+
* stranded by them.
|
|
19
16
|
*/
|
|
20
|
-
export default class DurableRuns extends
|
|
17
|
+
export default class DurableRuns extends RunFilterCommand {
|
|
21
18
|
static commandName = 'durable:runs';
|
|
22
|
-
static description = 'List
|
|
23
|
-
|
|
24
|
-
async run() {
|
|
25
|
-
const engine = await this.app.container.make(WorkflowEngine);
|
|
19
|
+
static description = 'List durable workflow runs (filters, paging, --stale)';
|
|
20
|
+
async perform() {
|
|
26
21
|
const wantsStale = this.stale !== undefined;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
const query = this.runFilter();
|
|
23
|
+
// No explicit --status: `--stale` reads the only statuses a stranded dispatch shows up in, so
|
|
24
|
+
// newer terminal runs don't push a stale candidate off the page.
|
|
25
|
+
if (wantsStale && !query.filter?.status) {
|
|
26
|
+
query.filter = { ...query.filter, status: ['running', 'suspended', 'cancelling'] };
|
|
27
|
+
}
|
|
28
|
+
const deps = await this.deps();
|
|
29
|
+
const body = await this.call(listRuns, {
|
|
30
|
+
query: {
|
|
31
|
+
...query,
|
|
32
|
+
...(this.page !== undefined ? { page: String(this.page) } : {}),
|
|
33
|
+
...(this.size !== undefined ? { size: String(this.size) } : {}),
|
|
34
|
+
},
|
|
35
|
+
}, deps);
|
|
36
|
+
// The liveness columns read each in-flight run's checkpoints through the same port.
|
|
37
|
+
const runs = body.data.map((row) => ({ ...row, updatedAt: new Date(row.updatedAt) }));
|
|
38
|
+
const lister = {
|
|
39
|
+
listRuns: async () => runs,
|
|
40
|
+
listCheckpoints: (id) => deps.engine.listCheckpoints(id),
|
|
41
|
+
};
|
|
42
|
+
let live = await attachLiveness(lister, runs);
|
|
43
|
+
if (wantsStale) {
|
|
44
|
+
const threshold = this.stale === ''
|
|
45
|
+
? DEFAULT_STALE_MS
|
|
46
|
+
: (parseDurationMs(this.stale ?? '') ?? DEFAULT_STALE_MS);
|
|
47
|
+
live = filterStale(live, threshold);
|
|
48
|
+
}
|
|
49
|
+
if (this.json) {
|
|
50
|
+
const kept = new Set(live.map((l) => l.run.id));
|
|
51
|
+
const liveness = new Map(live.map((l) => [l.run.id, l.stalePending]));
|
|
52
|
+
this.printJson({
|
|
53
|
+
data: body.data
|
|
54
|
+
.filter((row) => kept.has(row.id))
|
|
55
|
+
.map((row) => ({ ...row, pending: liveness.get(row.id) ?? null })),
|
|
56
|
+
meta: body.meta,
|
|
57
|
+
});
|
|
41
58
|
return;
|
|
42
59
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.logger.warning(staleHint(run.id));
|
|
60
|
+
this.logger.log(renderRunsTable(live));
|
|
61
|
+
if (live.length > 0 || body.meta.total > 0)
|
|
62
|
+
this.logger.log(pageFooter(body.meta));
|
|
63
|
+
if (wantsStale)
|
|
64
|
+
for (const { run } of live)
|
|
65
|
+
this.logger.warning(staleHint(run.id));
|
|
50
66
|
}
|
|
51
67
|
}
|
|
52
68
|
__decorate([
|
|
53
|
-
flags.
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
], DurableRuns.prototype, "status", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
flags.string({ description: 'Filter by workflow name' })
|
|
59
|
-
], DurableRuns.prototype, "workflow", void 0);
|
|
69
|
+
flags.number({ description: 'Page, 1-based (default 1)' })
|
|
70
|
+
], DurableRuns.prototype, "page", void 0);
|
|
60
71
|
__decorate([
|
|
61
|
-
flags.number({ description: '
|
|
62
|
-
], DurableRuns.prototype, "
|
|
72
|
+
flags.number({ description: 'Rows per page (default 50, at most 200)' })
|
|
73
|
+
], DurableRuns.prototype, "size", void 0);
|
|
63
74
|
__decorate([
|
|
64
75
|
flags.string({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'
|
|
76
|
+
allowEmptyValue: true,
|
|
77
|
+
description: 'Only running/suspended/cancelling runs whose oldest pending remote step exceeds this age (the ' +
|
|
78
|
+
'"probably stranded" view). Bare --stale uses 15m; --stale=1h / --stale=90s set your own.',
|
|
68
79
|
})
|
|
69
80
|
], DurableRuns.prototype, "stale", void 0);
|
|
70
81
|
//# sourceMappingURL=runs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../commands/runs.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../commands/runs.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,SAAS,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAaxD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,gBAAgB;IACvD,MAAM,CAAU,WAAW,GAAG,cAAc,CAAC;IAC7C,MAAM,CAAU,WAAW,GAAG,uDAAuD,CAAC;IAgB5E,KAAK,CAAC,OAAO;QACrB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAA0C,CAAC;QACvE,8FAA8F;QAC9F,iEAAiE;QACjE,IAAI,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YACxC,KAAK,CAAC,MAAM,GAAG,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC;QACrF,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,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C,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;yCACrC;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;yCACnD;AAQd;IANP,KAAK,CAAC,MAAM,CAAC;QACZ,eAAe,EAAE,IAAI;QACrB,WAAW,EACT,gGAAgG;YAChG,0FAA0F;KAC7F,CAAC;0CACqB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RunFilterCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:bulk <retry|cancel> [filters]` — retry or cancel every run matching the
|
|
4
|
+
* filters (at most 500), through the console's `POST /bulk/:action`. A run that cannot take the
|
|
5
|
+
* action is skipped. `--dry-run` lists what would be acted on; otherwise it asks first (`--force`
|
|
6
|
+
* skips).
|
|
7
|
+
*/
|
|
8
|
+
export default class DurableRunsBulk extends RunFilterCommand {
|
|
9
|
+
static commandName: string;
|
|
10
|
+
static description: string;
|
|
11
|
+
action: string;
|
|
12
|
+
compensate: boolean;
|
|
13
|
+
dryRun: boolean;
|
|
14
|
+
force: boolean;
|
|
15
|
+
protected perform(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=runs_bulk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_bulk.d.ts","sourceRoot":"","sources":["../../commands/runs_bulk.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAQlF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,gBAAgB;IAC3D,OAAgB,WAAW,SAAuB;IAClD,OAAgB,WAAW,SAA+D;IAGlF,MAAM,EAAE,MAAM,CAAC;IAGf,UAAU,EAAE,OAAO,CAAC;IAGpB,MAAM,EAAE,OAAO,CAAC;IAGhB,KAAK,EAAE,OAAO,CAAC;IAEvB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAsDvC;CACF"}
|