@tenetkit/pg 0.38.1 → 0.38.2

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.
@@ -331,8 +331,15 @@ export const postgresOperations = (input) => {
331
331
  WHERE run_id = ${op.runId} AND operation_id = ${op.operationId} AND status = 'unknown'
332
332
  `;
333
333
  }
334
+ const unresolved = yield* sql `
335
+ SELECT COUNT(*)::int AS unresolved FROM tenetkit_run_operations
336
+ WHERE run_id = ${op.runId} AND status = 'unknown'
337
+ `;
338
+ const runStatus = Number(unresolved[0]?.unresolved ?? 0) > 0
339
+ ? sql `'needs-resolution'`
340
+ : sql `CASE WHEN cancellation_requested THEN 'cancelling' ELSE 'queued' END`;
334
341
  yield* sql `
335
- UPDATE tenetkit_runs SET status = CASE WHEN cancellation_requested THEN 'cancelling' ELSE 'queued' END, owner_worker_id = NULL, lease_expires_at = NULL, updated_at = NOW()
342
+ UPDATE tenetkit_runs SET status = ${runStatus}, owner_worker_id = NULL, lease_expires_at = NULL, updated_at = NOW()
336
343
  WHERE run_id = ${op.runId} AND status = 'needs-resolution'
337
344
  `;
338
345
  yield* settleAdmittedCancellation(hub, op.runId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.38.1",
3
+ "version": "0.38.2",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@effect/sql-pg": "4.0.0-rc.111",
42
- "tenetkit": "0.38.1"
42
+ "tenetkit": "0.38.2"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@effect/vitest": "4.0.0-rc.111",