feat: 添加语音模块支持,优化服务启动方式
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user