mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
refactor: replace OpenCode server restarts with config reloads for faster updates (#70)
This commit is contained in:
1 parent
8be0bbd8a0
commit
2bd2b024b8
11 files changed
+183
-107
No files matched your search
@@ -103,6 +103,19 @@ export const settingsApi = {
|
||||
return data
|
||||
},
|
||||
|
||||
reloadOpenCodeConfig: async (): Promise<{ success: boolean; message: string; details?: string }> => {
|
||||
try {
|
||||
const { data } = await axios.post(`${API_BASE_URL}/api/settings/opencode-reload`)
|
||||
return data
|
||||
} catch (error) {
|
||||
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
||||
const result = await axios.post(`${API_BASE_URL}/api/settings/opencode-restart`)
|
||||
return result.data
|
||||
}
|
||||
throw error
|
||||
}
|
||||
},
|
||||
|
||||
rollbackOpenCodeConfig: async (): Promise<{ success: boolean; message: string; configName?: string }> => {
|
||||
const { data } = await axios.post(`${API_BASE_URL}/api/settings/opencode-rollback`)
|
||||
return data
|
||||
|
||||
Reference in new issue
Block a user