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

Function checkIfRunnerRunningAndCleanupStaleState

cli/src/runner/controlClient.ts:140–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138 * For instance when running `hapi runner status` we can show more information.
139 */
140export async function checkIfRunnerRunningAndCleanupStaleState(): Promise<boolean> {
141 const state = await readRunnerState();
142 if (!state) {
143 return false;
144 }
145
146 // Check if the runner is running
147 if (isProcessAlive(state.pid)) {
148 return true;
149 }
150
151 logger.debug('[RUNNER RUN] Runner PID not running, cleaning up state');
152 await cleanupRunnerState();
153 return false;
154}
155
156/**
157 * Check if the running runner version matches the current CLI version.

Callers 4

waitForRunnerToStopFunction · 0.90
runner.tsFile · 0.90
runDoctorCommandFunction · 0.90

Calls 4

readRunnerStateFunction · 0.90
isProcessAliveFunction · 0.90
cleanupRunnerStateFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected