src/vs/platform/storage/electron-main/storageMainService.ts/StorageMainService/registerListeners
class StorageMainService:	private registerListeners(): void {

		// Global Storage: Warmup when any window opens
		(async () => {
			await this.lifecycleMainService.when(LifecycleMainPhase.AfterWindowOpen);

			this.globalStorage.init();
		})();

		// Workspace Storage: Warmup when related window with workspace loads
		this._register(this.lifecycleMainService.onWillLoadWindow(async e => {
			if (e.workspace) {
				this.workspaceStorage(e.workspace).init();
			}
		}));

		// All Storage: Close when shutting down
		this._register(this.lifecycleMainService.onWillShutdown(e => {
			this.logService.trace('storageMainService#onWillShutdown()');

			// Remember shutdown reason
			this.shutdownReason = e.reason;

			// Global Storage
			e.join(this.globalStorage.close());

			// Workspace Storage(s)
			for (const [, storage] of this.mapWorkspaceToStorage) {
				e.join(storage.close());
			}
		}));
	}