MCPcopy Create free account
hub / github.com/TanStack/db / clearJob

Method clearJob

packages/db/src/scheduler.ts:207–219  ·  view source on GitHub ↗

Remove a single job from a context and clean up its dependencies.

(contextId: SchedulerContextId, jobId: unknown)

Source from the content-addressed store, hash-verified

205
206 /** Remove a single job from a context and clean up its dependencies. */
207 clearJob(contextId: SchedulerContextId, jobId: unknown): void {
208 const context = this.contexts.get(contextId)
209 if (!context) return
210
211 context.jobs.delete(jobId)
212 context.dependencies.delete(jobId)
213 context.completed.delete(jobId)
214 context.queue = context.queue.filter((id) => id !== jobId)
215
216 if (context.jobs.size === 0) {
217 this.contexts.delete(contextId)
218 }
219 }
220}
221
222export const transactionScopedScheduler = new Scheduler()

Callers

nothing calls this directly

Calls 3

filterMethod · 0.80
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected