From 0ad3753d15d3ccb9518b989fcfd87aff8b1fa73b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 25 Nov 2017 10:34:55 +0100 Subject: [PATCH] macOS: try to flush localStorage earlier before quitting (for #39125) --- .../platform/update/electron-main/updateService.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vs/platform/update/electron-main/updateService.ts b/src/vs/platform/update/electron-main/updateService.ts index 907364dbd20..fd852124afc 100644 --- a/src/vs/platform/update/electron-main/updateService.ts +++ b/src/vs/platform/update/electron-main/updateService.ts @@ -268,18 +268,18 @@ export class UpdateService implements IUpdateService { return TPromise.as(null); } + // for some reason updating on Mac causes the local storage not to be flushed. + // we workaround this issue by forcing an explicit flush of the storage data. + // see also https://github.com/Microsoft/vscode/issues/172 + if (process.platform === 'darwin') { + electron.session.defaultSession.flushStorageData(); + } + this.lifecycleService.quit(true /* from update */).done(vetod => { if (vetod) { return; } - // for some reason updating on Mac causes the local storage not to be flushed. - // we workaround this issue by forcing an explicit flush of the storage data. - // see also https://github.com/Microsoft/vscode/issues/172 - if (process.platform === 'darwin') { - electron.session.defaultSession.flushStorageData(); - } - this.raw.quitAndInstall(); }); -- GitLab