fix: stop orphaned opencode processes on desktop quit
Exit the desktop app without waiting on background cleanup Kill managed OpenCode by process group with a port fallback Make OpenCode shutdown reuse the active shutdown promise
This commit is contained in:
@@ -29,7 +29,9 @@ export const createGracefulShutdownRuntime = (dependencies) => {
|
||||
tunnelAuthController,
|
||||
} = dependencies;
|
||||
|
||||
const gracefulShutdown = async (options = {}) => {
|
||||
let shutdownPromise = null;
|
||||
|
||||
const runShutdown = async (options = {}) => {
|
||||
if (getIsShuttingDown()) return;
|
||||
|
||||
setIsShuttingDown(true);
|
||||
@@ -133,6 +135,12 @@ export const createGracefulShutdownRuntime = (dependencies) => {
|
||||
}
|
||||
};
|
||||
|
||||
const gracefulShutdown = (options = {}) => {
|
||||
if (shutdownPromise) return shutdownPromise;
|
||||
shutdownPromise = runShutdown(options);
|
||||
return shutdownPromise;
|
||||
};
|
||||
|
||||
return {
|
||||
gracefulShutdown,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user