MCPcopy
hub / github.com/simstudioai/sim / markJobFailed

Function markJobFailed

apps/sim/lib/table/jobs/service.ts:362–368  ·  view source on GitHub ↗
(tableId: string, jobId: string, error: string)

Source from the content-addressed store, hash-verified

360 * in-flight run (so a stale worker can't clobber a newer job or a cancel).
361 */
362export async function markJobFailed(tableId: string, jobId: string, error: string): Promise<void> {
363 const now = new Date()
364 await db
365 .update(tableJobs)
366 .set({ status: 'failed', error: error.slice(0, 2000), completedAt: now, updatedAt: now })
367 .where(ownsActiveJob(tableId, jobId))
368}
369
370/**
371 * Marks an in-flight job canceled (user-initiated). No-op unless it's still running. The

Callers 5

runTableImportFunction · 0.90
markTableUpdateFailedFunction · 0.90
runTableExportFunction · 0.90
runTableBackfillFunction · 0.90
markTableDeleteFailedFunction · 0.90

Calls 2

ownsActiveJobFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected