Defer OpenCode restarts for config mutations
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
This commit is contained in:
co-authored by
Serhii Dziupin
parent
824d1fbbf4
commit
775da6e9f4
@@ -1,3 +1,5 @@
|
||||
import { buildExternalManualRestartResponse } from './config-mutation-response.js';
|
||||
|
||||
const parseLoopbackUrl = (rawUrl) => {
|
||||
if (typeof rawUrl !== 'string') {
|
||||
return null;
|
||||
@@ -1024,7 +1026,13 @@ export const registerSettingsUtilityRoutes = (app, dependencies) => {
|
||||
try {
|
||||
console.log('[Server] Manual configuration reload requested');
|
||||
|
||||
await refreshOpenCodeAfterConfigChange('manual configuration reload');
|
||||
const refreshResult = await refreshOpenCodeAfterConfigChange('manual configuration reload');
|
||||
|
||||
if (refreshResult?.external) {
|
||||
return res.json(buildExternalManualRestartResponse(
|
||||
'Configuration is saved on disk. Restart your connected OpenCode server to apply the changes.',
|
||||
));
|
||||
}
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user