(jobId: number)
| 255 | } |
| 256 | |
| 257 | async function markJobCompleted(jobId: number): Promise<void> { |
| 258 | await db |
| 259 | .update(pipelineJobs) |
| 260 | .set({ status: "completed", completedAt: new Date() }) |
| 261 | .where(eq(pipelineJobs.id, jobId)); |
| 262 | } |
| 263 | |
| 264 | async function markJobFailed(jobId: number, error: string, attempts: number, maxAttempts: number): Promise<void> { |
| 265 | const newStatus = attempts + 1 >= maxAttempts ? "failed" : "pending"; |