fix: linux automatic update not working #1179
Massimo Melina committed
Mar 15, 2026 at 22:53 UTC
e26f87f7ec6bf74bc7176d5fd184befb14772eec
1 file changed
+4
src/listen.ts
+4
@@ -23,11 +23,15 @@ import { defaultBaseUrl } from './nat'
23
import { storedMap } from './persistence'
24
import { argv } from './argv'
25
import { consoleHint } from './consoleLog'
26
+import { onProcessExit } from './first'
27
28
interface ServerExtra { name: string, error?: string, busy?: Promise<string> }
29
let httpSrv: undefined | http.Server & ServerExtra
30
let httpsSrv: undefined | http.Server & ServerExtra
31
32
+// update relaunch can keep a bridge process alive, so we proactively close listeners here to release ports before the next binary binds
33
+onProcessExit(() => Promise.all([stopServer(httpSrv), stopServer(httpsSrv)]))
34
+
35
const openBrowserAtStart = defineConfig('open_browser_at_start', true)
36
37
export const baseUrl = defineConfig(CFG.base_url, '',