MCPcopy Create free account
hub / github.com/EvoMap/evolver / writeCycleProgressAtomic

Function writeCycleProgressAtomic

index.js:455–465  ·  view source on GitHub ↗
(progressPath, fields)

Source from the content-addressed store, hash-verified

453// wrapper treats the inner core as zombie and SIGKILLs it. See Issue #19 (the
454// 22-day stuck-cycle incident) and the cross-repo timeout plan for context.
455function writeCycleProgressAtomic(progressPath, fields) {
456 try {
457 const data = Object.assign({}, fields, { updated_at: Date.now() });
458 const tmp = progressPath + '.tmp.' + process.pid;
459 fs.writeFileSync(tmp, JSON.stringify(data, null, 2) + '\n', 'utf8');
460 fs.renameSync(tmp, progressPath);
461 return true;
462 } catch (e) {
463 return false;
464 }
465}
466
467function handleCycleTimeout({ error, cycleProgressPath, progressFields, suicideEnabled, args, logPath, spawnReplacementFn }) {
468 const msg = error && error.message ? String(error.message) : String(error);

Callers 3

handleCycleTimeoutFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected