MCPcopy Create free account
hub / github.com/simstudioai/sim / ownsActiveJob

Function ownsActiveJob

apps/sim/lib/table/jobs/service.ts:335–341  ·  view source on GitHub ↗

Shared WHERE for terminal transitions: this job run, and still in-flight (write-once).

(tableId: string, jobId: string)

Source from the content-addressed store, hash-verified

333
334/** Shared WHERE for terminal transitions: this job run, and still in-flight (write-once). */
335function ownsActiveJob(tableId: string, jobId: string) {
336 return and(
337 eq(tableJobs.id, jobId),
338 eq(tableJobs.tableId, tableId),
339 eq(tableJobs.status, 'running')
340 )
341}
342
343/**
344 * Marks a job complete. No-op unless it's still this in-flight run. Returns whether it

Callers 6

updateJobProgressFunction · 0.85
getJobProgressFunction · 0.85
setJobResultKeyFunction · 0.85
markJobReadyFunction · 0.85
markJobFailedFunction · 0.85
markJobCanceledFunction · 0.85

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected