fix browser use

This commit is contained in:
Simos Mikelatos
2026-06-17 15:35:55 +00:00
parent 6af4afe6f2
commit a0d56429a7
8 changed files with 100 additions and 25 deletions

View File

@@ -1714,8 +1714,16 @@ async function startServer() {
await closeSessionsWatcher();
// Clean up plugin processes on shutdown
const shutdownRuntimeServices = async () => {
await browserUseService.stopAllSessions();
await stopAllPlugins();
try {
await browserUseService.stopAllSessions();
} catch (err) {
console.error('[Browser Use] Error stopping sessions during shutdown:', err?.message || err);
}
try {
await stopAllPlugins();
} catch (err) {
console.error('[Plugins] Error stopping plugins during shutdown:', err?.message || err);
}
process.exit(0);
};
process.on('SIGTERM', () => void shutdownRuntimeServices());