(tableId: string, jobId: string)
| 373 | * place (no rollback). Returns whether a running job was actually canceled. |
| 374 | */ |
| 375 | export async function markJobCanceled(tableId: string, jobId: string): Promise<boolean> { |
| 376 | const now = new Date() |
| 377 | const updated = await db |
| 378 | .update(tableJobs) |
| 379 | .set({ status: 'canceled', completedAt: now, updatedAt: now }) |
| 380 | .where(ownsActiveJob(tableId, jobId)) |
| 381 | .returning({ id: tableJobs.id }) |
| 382 | return updated.length > 0 |
| 383 | } |
no test coverage detected