mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 14:07:20 +08:00
fix: Clear RPC channel for faster shutdown
This commit is contained in:
@@ -140,10 +140,14 @@ export const rpc = {
|
||||
await Promise.race([
|
||||
Instance.disposeAll(),
|
||||
new Promise((resolve) => {
|
||||
setTimeout(resolve, 5000)
|
||||
setTimeout(resolve, 5000).unref()
|
||||
}),
|
||||
])
|
||||
if (server) server.stop(true)
|
||||
// Clear the Rpc message channel so the worker's event loop can drain and
|
||||
// exit naturally. Without this, the active onmessage handle keeps the
|
||||
// worker alive even after all async work is done.
|
||||
onmessage = null
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user