(doc: ClockDoc)
| 453 | // Persist deferred completion (first-writer-wins via createIfMissing), |
| 454 | // resume the workflow, then clean up the clock doc. |
| 455 | const fireClock = (doc: ClockDoc): Effect.Effect<void> => |
| 456 | Effect.gen(function*() { |
| 457 | const created = yield* createIfMissing<DeferredDoc>({ |
| 458 | id: deferredKey(doc.deferredName), |
| 459 | _partitionKey: doc._partitionKey, |
| 460 | type: "deferred", |
| 461 | exit: yield* encodeDeferredExit(Exit.void) |
| 462 | }) |
| 463 | .pipe(annotate("clockFire", doc._partitionKey)) |
| 464 | if (created) yield* driveById(doc._partitionKey) |
| 465 | yield* Effect.promise(() => container.item(doc.id, doc._partitionKey).delete()).pipe( |
| 466 | Effect.catchCause(() => Effect.void) |
| 467 | ) |
| 468 | }) |
| 469 | |
| 470 | // Persist `interrupted: true`, retrying on OCC. A suspending driver's |
| 471 | // onComplete (or a heartbeat renewal) can win the etag race; silently |
no test coverage detected
searching dependent graphs…