MCPcopy Create free account
hub / github.com/tiann/hapi / readRunnerState

Function readRunnerState

cli/src/persistence.ts:185–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183 * Read runner state from local file
184 */
185export async function readRunnerState(): Promise<RunnerLocallyPersistedState | null> {
186 try {
187 if (!existsSync(configuration.runnerStateFile)) {
188 return null;
189 }
190 const content = await readFile(configuration.runnerStateFile, 'utf-8');
191 return JSON.parse(content) as RunnerLocallyPersistedState;
192 } catch (error) {
193 // State corrupted somehow :(
194 console.error(`[PERSISTENCE] Runner state file corrupted: ${configuration.runnerStateFile}`, error);
195 return null;
196 }
197}
198
199/**
200 * Write runner state to local file (synchronously for atomic operation)

Callers 9

runnerPostFunction · 0.90
waitForRunnerHandoffFunction · 0.90
stopRunnerFunction · 0.90
startRunnerFunction · 0.90
runDoctorCommandFunction · 0.90
listRunnerLogFilesFunction · 0.90

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected