mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 08:17:11 +00:00
fix: clarify CLIProxy dashboard install lifecycle
This commit is contained in:
@@ -51,6 +51,8 @@ export async function installDashboardCliproxyVersion(
|
||||
const backendLabel = backend === 'plus' ? 'CLIProxy Plus' : 'CLIProxy';
|
||||
const shouldRestoreService = await wasProxyRunning(deps);
|
||||
|
||||
// The installer owns the stop-and-replace lifecycle: it stops a running proxy
|
||||
// and waits for the port to free before swapping the binary.
|
||||
await deps.installCliproxyVersion(version, true, backend);
|
||||
|
||||
if (!shouldRestoreService) {
|
||||
|
||||
@@ -102,4 +102,24 @@ describe('installDashboardCliproxyVersion', () => {
|
||||
expect(calls.installCliproxyVersion).toBe(1);
|
||||
expect(calls.ensureCliproxyService).toBe(1);
|
||||
});
|
||||
|
||||
it('uses a fallback restart error when the start result omits one', async () => {
|
||||
const { deps } = createDeps({
|
||||
remoteRunning: true,
|
||||
startResult: {
|
||||
started: false,
|
||||
alreadyRunning: false,
|
||||
port: 8317,
|
||||
},
|
||||
});
|
||||
|
||||
const result = await installDashboardCliproxyVersion('6.7.1', 'plus', deps);
|
||||
|
||||
expect(result).toEqual<DashboardCliproxyInstallResult>({
|
||||
success: false,
|
||||
restarted: false,
|
||||
error: 'Installed CLIProxy Plus v6.7.1, but restart failed',
|
||||
message: 'Installed CLIProxy Plus v6.7.1, but failed to restart it',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user