diff --git a/lib/client.js b/lib/client.js index abee816..f965d70 100644 --- a/lib/client.js +++ b/lib/client.js @@ -3,7 +3,7 @@ const fs = require('fs'); const { getNotifySocket } = require('./systemd-env'); const WebSocket = require('ws'); -const { execSync, execFileSync } = require('child_process'); +const { execFileSync } = require('child_process'); const config = require('./config'); const log = require('./logger'); const { getBoxId } = require('./fingerprint'); @@ -550,13 +550,6 @@ class ClawClient { writeFileSync(configFile, `${JSON.stringify(config, null, 2)}\n`, 'utf8'); log.info('clawd', `openclaw config 已更新: ${newOrigin}`); - - try { - execSync('pkill -9 -x openclaw-gateway', { timeout: 3000 }); - log.info('clawd', 'openclaw-gateway 已终止,等待自动重启'); - } catch (_) { - log.info('clawd', 'openclaw-gateway 进程不存在,无需终止'); - } } catch (e) { log.warn('clawd', `openclaw config 更新失败: ${e.message}`); } diff --git a/lib/openclaw-provider.js b/lib/openclaw-provider.js index ed2a0f0..fe53669 100644 --- a/lib/openclaw-provider.js +++ b/lib/openclaw-provider.js @@ -282,7 +282,6 @@ function applyFullProviderFromVps(provider, onDone) { log.warn('openclaw-provider', `拉模型失败,使用空列表: ${err.message}`); } addProviderSync(configFile, name, baseUrl, apiKey, list, defaultModel); - restartGateway(); if (typeof onDone === 'function') { try { onDone(); @@ -290,6 +289,7 @@ function applyFullProviderFromVps(provider, onDone) { log.warn('openclaw-provider', `onDone: ${e.message}`); } } + restartGateway(); } catch (e) { log.error('openclaw-provider', `apply 写配置失败: ${e.message}`); } finally {