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

Function markCronTasksFired

source code/utils/cronTasks.ts:263–280  ·  view source on GitHub ↗
(
  ids: string[],
  firedAt: number,
  dir?: string,
)

Source from the content-addressed store, hash-verified

261 * just-written `lastFiredAt` — idempotent (same computation, same answer).
262 */
263export async function markCronTasksFired(
264 ids: string[],
265 firedAt: number,
266 dir?: string,
267): Promise<void> {
268 if (ids.length === 0) return
269 const idSet = new Set(ids)
270 const tasks = await readCronTasks(dir)
271 let changed = false
272 for (const t of tasks) {
273 if (idSet.has(t.id)) {
274 t.lastFiredAt = firedAt
275 changed = true
276 }
277 }
278 if (!changed) return
279 await writeCronTasks(tasks, dir)
280}
281
282/**
283 * File-backed tasks + session-only tasks, merged. Session tasks get

Callers 1

checkFunction · 0.85

Calls 3

readCronTasksFunction · 0.85
writeCronTasksFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected