MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / removeCronTasks

Function removeCronTasks

source code/utils/cronTasks.ts:233–250  ·  view source on GitHub ↗
(
  ids: string[],
  dir?: string,
)

Source from the content-addressed store, hash-verified

231 * state on that path (tests enforce this).
232 */
233export async function removeCronTasks(
234 ids: string[],
235 dir?: string,
236): Promise<void> {
237 if (ids.length === 0) return
238 // Sweep session store first. If every id was accounted for there, we're
239 // done — skip the file read entirely. removeSessionCronTasks is a no-op
240 // (returns 0) on miss, so pre-existing durable-delete paths fall through
241 // without allocating.
242 if (dir === undefined && removeSessionCronTasks(ids) === ids.length) {
243 return
244 }
245 const idSet = new Set(ids)
246 const tasks = await readCronTasks(dir)
247 const remaining = tasks.filter(t => !idSet.has(t.id))
248 if (remaining.length === tasks.length) return
249 await writeCronTasks(remaining, dir)
250}
251
252/**
253 * Stamp `lastFiredAt` on the given recurring tasks and write back. Batched

Callers 4

callFunction · 0.85
loadFunction · 0.85
processFunction · 0.85
useScheduledTasksFunction · 0.85

Calls 4

removeSessionCronTasksFunction · 0.85
readCronTasksFunction · 0.85
writeCronTasksFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected