MCPcopy
hub / github.com/codeaashu/claude-code / markCronTasksFired

Function markCronTasksFired

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

Source from the content-addressed store, hash-verified

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