(initial: ExecState)
| 320 | .pipe(annotate("replaceExec", state.executionId)) |
| 321 | |
| 322 | const createExec = (initial: ExecState): Effect.Effect<boolean> => |
| 323 | exec( |
| 324 | `INSERT INTO "${execTable}" |
| 325 | (execution_id, workflow_name, payload, parent, status, suspended, interrupted, etag) |
| 326 | VALUES (?, ?, ?, ?, ?, ?, ?, ?) |
| 327 | ON CONFLICT DO NOTHING |
| 328 | RETURNING execution_id`, |
| 329 | [ |
| 330 | initial.executionId, |
| 331 | initial.workflowName, |
| 332 | initial.payload, |
| 333 | initial.parent ?? null, |
| 334 | initial.status, |
| 335 | initial.suspended ? 1 : 0, |
| 336 | initial.interrupted ? 1 : 0, |
| 337 | initial.etag |
| 338 | ] |
| 339 | ) |
| 340 | .pipe( |
| 341 | Effect.map((rows) => (rows as ReadonlyArray<unknown>).length > 0), |
| 342 | annotate("createExec", initial.executionId) |
| 343 | ) |
| 344 | |
| 345 | // First-writer-wins persistence of an activity result; returns true if this |
| 346 | // call won, false if another writer beat us to the (exec, name, attempt) row. |
no test coverage detected
searching dependent graphs…