@aikirun/task 0.12.0 → 0.14.0

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -8
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -203,17 +203,14 @@ var TaskImpl = class _TaskImpl {
203
203
  if (existingTaskInfo?.state) {
204
204
  const taskId2 = existingTaskInfo.id;
205
205
  const state = existingTaskInfo?.state;
206
- this.assertRetryAllowed(taskId2, state, retryStrategy, run.logger);
206
+ attempts = state.attempts;
207
+ this.assertRetryAllowed(taskId2, attempts, retryStrategy, run.logger);
207
208
  run.logger.debug("Retrying task", {
208
209
  "aiki.taskName": this.name,
209
210
  "aiki.taskId": taskId2,
210
- "aiki.attempts": state.attempts,
211
+ "aiki.attempts": attempts,
211
212
  "aiki.taskStatus": state.status
212
213
  });
213
- attempts = state.attempts;
214
- if (state.status === "awaiting_retry" && handle.run.state.status === "running") {
215
- throw new WorkflowRunSuspendedError(run.id);
216
- }
217
214
  }
218
215
  attempts++;
219
216
  const options = { retry: retryStrategy, reference };
@@ -321,8 +318,7 @@ var TaskImpl = class _TaskImpl {
321
318
  throw error;
322
319
  }
323
320
  }
324
- assertRetryAllowed(taskId, state, retryStrategy, logger) {
325
- const { attempts } = state;
321
+ assertRetryAllowed(taskId, attempts, retryStrategy, logger) {
326
322
  const retryParams = getRetryParams(attempts, retryStrategy);
327
323
  if (!retryParams.retriesLeft) {
328
324
  logger.error("Task retry not allowed", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikirun/task",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Task SDK for Aiki - define reliable tasks with automatic retries, idempotency, and error handling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,8 +18,8 @@
18
18
  "build": "tsup"
19
19
  },
20
20
  "dependencies": {
21
- "@aikirun/types": "0.12.0",
22
- "@aikirun/workflow": "0.12.0",
21
+ "@aikirun/types": "0.14.0",
22
+ "@aikirun/workflow": "0.14.0",
23
23
  "@standard-schema/spec": "^1.1.0"
24
24
  },
25
25
  "publishConfig": {