( tableId: string, rowsProcessed: number, jobId: string )
| 179 | * in-flight job. |
| 180 | */ |
| 181 | export async function updateJobProgress( |
| 182 | tableId: string, |
| 183 | rowsProcessed: number, |
| 184 | jobId: string |
| 185 | ): Promise<boolean> { |
| 186 | const updated = await db |
| 187 | .update(tableJobs) |
| 188 | .set({ rowsProcessed, updatedAt: new Date() }) |
| 189 | .where(ownsActiveJob(tableId, jobId)) |
| 190 | .returning({ id: tableJobs.id }) |
| 191 | return updated.length > 0 |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Reads the persisted progress of an in-flight job this worker still owns (`null` when the job |
no test coverage detected