fix(web): refine OpenCode health monitoring
This commit is contained in:
@@ -1886,11 +1886,11 @@ function startHealthMonitoring() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
healthCheckInterval = setInterval(async () => {
|
healthCheckInterval = setInterval(async () => {
|
||||||
if (!openCodeProcess || isShuttingDown) return;
|
if (!openCodeProcess || isShuttingDown || isRestartingOpenCode) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const healthy = await isOpenCodeProcessHealthy();
|
||||||
if (openCodeProcess.exitCode !== null) {
|
if (!healthy) {
|
||||||
console.log('OpenCode process not running, restarting...');
|
console.log('OpenCode process not running, restarting...');
|
||||||
await restartOpenCode();
|
await restartOpenCode();
|
||||||
}
|
}
|
||||||
@@ -1976,7 +1976,7 @@ async function main(options = {}) {
|
|||||||
status: 'ok',
|
status: 'ok',
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
openCodePort: openCodePort,
|
openCodePort: openCodePort,
|
||||||
openCodeRunning: Boolean(openCodeProcess && openCodeProcess.exitCode === null),
|
openCodeRunning: Boolean(openCodePort && isOpenCodeReady && !isRestartingOpenCode),
|
||||||
openCodeApiPrefix,
|
openCodeApiPrefix,
|
||||||
openCodeApiPrefixDetected,
|
openCodeApiPrefixDetected,
|
||||||
isOpenCodeReady,
|
isOpenCodeReady,
|
||||||
|
|||||||
Reference in New Issue
Block a user