MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / startHeartbeat

Function startHeartbeat

src/index.js:477–497  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

475 await fs.rename(temp, target);
476 return;
477 } catch (error) {
478 lastError = error;
479 if (error?.code === "EXDEV")
480 break;
481 if (!isRetriableStateWriteError(error))
482 throw error;
483 if (attempt < attempts - 1)
484 await delay(25 * (attempt + 1));
485 }
486 }
487 for (let attempt = 0;attempt < attempts; attempt++) {
488 try {
489 await fs.copyFile(temp, target);
490 return;
491 } catch (error) {
492 lastError = error;
493 if (!isRetriableStateWriteError(error))
494 throw error;
495 if (attempt < attempts - 1)
496 await delay(25 * (attempt + 1));
497 }
498 }
499 try {
500 await fs.writeFile(target, contents, encoding);

Callers 1

rememberSessionFunction · 0.85

Calls 5

nowFunction · 0.85
finalizeActiveRunFunction · 0.85
maybeRunDueJobsFunction · 0.85
appendLoopLogFunction · 0.85
sdkErrorMessageFunction · 0.85

Tested by

no test coverage detected