Stop all extensions before quitting app (#7450)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2023-03-31 13:37:29 -04:00
1 parent 37c92c8fd1
commit a0fea20300
2 files changed
+29 -1

No files matched your search

@@ -8,6 +8,7 @@ import clusterManagerInjectable from "./cluster/manager.injectable";
import loggerInjectable from "../common/logger.injectable";
import closeAllWindowsInjectable from "./start-main-application/lens-window/hide-all-windows/close-all-windows.injectable";
import emitAppEventInjectable from "../common/app-event-bus/emit-event.injectable";
import stopAllExtensionsInjectable from "../features/extensions/stopping/main/stop-all.injectable";
const stopServicesAndExitAppInjectable = getInjectable({
id: "stop-services-and-exit-app",
@@ -18,11 +19,13 @@ const stopServicesAndExitAppInjectable = getInjectable({
const logger = di.inject(loggerInjectable);
const closeAllWindows = di.inject(closeAllWindowsInjectable);
const emitAppEvent = di.inject(emitAppEventInjectable);
const stopAllExtensions = di.inject(stopAllExtensionsInjectable);
return () => {
return async () => {
emitAppEvent({ name: "service", action: "close" });
closeAllWindows();
clusterManager.stop();
await stopAllExtensions();
logger.info("SERVICE:QUIT");
setTimeout(exitApp, 1000);
};