(
executionId: string,
name: string,
attempt: number,
encoded: string
)
| 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. |
| 347 | const createActivity = ( |
| 348 | executionId: string, |
| 349 | name: string, |
| 350 | attempt: number, |
| 351 | encoded: string |
| 352 | ): Effect.Effect<boolean> => |
| 353 | exec( |
| 354 | `INSERT INTO "${activityTable}" (execution_id, name, attempt, result) |
| 355 | VALUES (?, ?, ?, ?) |
| 356 | ON CONFLICT DO NOTHING |
| 357 | RETURNING execution_id`, |
| 358 | [executionId, name, attempt, encoded] |
| 359 | ) |
| 360 | .pipe(Effect.map((rows) => (rows as ReadonlyArray<unknown>).length > 0)) |
| 361 | |
| 362 | // Overwrites a previously persisted *suspended* activity result so the next |
| 363 | // attempt can record its real outcome. |
no test coverage detected
searching dependent graphs…