(tableId: string, jobId: string)
| 162 | * newer run. A sync route claims, writes, then releases here in a `finally`. |
| 163 | */ |
| 164 | export async function releaseJobClaim(tableId: string, jobId: string): Promise<void> { |
| 165 | await db |
| 166 | .delete(tableJobs) |
| 167 | .where( |
| 168 | and(eq(tableJobs.id, jobId), eq(tableJobs.tableId, tableId), eq(tableJobs.status, 'running')) |
| 169 | ) |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Records job progress (rows processed so far) and bumps `updated_at` so the stale-job janitor |
no test coverage detected