feat: 添加语音模块支持,优化服务启动方式

This commit is contained in:
2026-03-17 04:03:39 +08:00
parent 308df54a15
commit 90517f2289
18 changed files with 221 additions and 43 deletions

View File

@@ -150,7 +150,8 @@ class OpenCodeService {
try {
log.info('[OpenCodeService] Stopping...');
const pid = this.process.pid;
const pid = this.process?.pid;
const processRef = this.process;
this.process = null;
this._isRunning = false;
@@ -165,11 +166,11 @@ class OpenCodeService {
resolve({ success: true });
});
});
} else if (pid) {
this.process?.kill('SIGTERM');
} else if (pid && processRef) {
processRef.kill('SIGTERM');
await new Promise<void>((resolve) => setTimeout(resolve, 1000));
if (this.process && !this.process.killed) {
this.process.kill('SIGKILL');
if (!processRef.killed) {
processRef.kill('SIGKILL');
}
this.restartAttempts = 0;
log.info('[OpenCodeService] Stopped');