mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-03 18:16:29 +00:00
fix(docker): address review findings — PID guard, deleteBinary guard, blocked fallback
- Guard child.pid falsy in bootstrap (PID 0 creates immortal phantom lock) - Add ETXTBSY/EBUSY guard to deleteBinary() (same vuln as downloadAndInstall) - Fix error message to suggest container restart (not circular ccs docker update) - Tighten status.blocked guard to handle missing blocker gracefully
This commit is contained in:
@@ -37,8 +37,9 @@ async function runCliproxy(): Promise<number> {
|
||||
// Register session lock so dashboard can detect the running proxy
|
||||
let sessionId: string | undefined;
|
||||
child.on('spawn', () => {
|
||||
const version = getInstalledCliproxyVersion() ?? undefined;
|
||||
sessionId = registerSession(CLIPROXY_DEFAULT_PORT, child.pid ?? 0, version, 'plus');
|
||||
if (!child.pid) return;
|
||||
const version = getInstalledCliproxyVersion();
|
||||
sessionId = registerSession(CLIPROXY_DEFAULT_PORT, child.pid, version, 'plus');
|
||||
});
|
||||
|
||||
child.on('error', reject);
|
||||
|
||||
Reference in New Issue
Block a user