Skip to content

Commit 753732c

Browse files
ahinklejoaomoreno
authored andcommitted
Check for updates only once at launch (microsoft#72169)
* Check for updates only once at launch * Update Mode Fix * Add Start to enum config * Check For Updates on Startup
1 parent 5481dcc commit 753732c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/vs/platform/update/electron-main/abstractUpdateService.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ export abstract class AbstractUpdateService implements IUpdateService {
8181
return;
8282
}
8383

84-
// Start checking for updates after 30 seconds
85-
this.scheduleCheckForUpdates(30 * 1000).then(undefined, err => this.logService.error(err));
84+
if (updateMode === 'start') {
85+
this.logService.info('update#ctor - startup checks only; automatic updates are disabled by user preference');
86+
this.checkForUpdates(null);
87+
} else {
88+
// Create schedule after checking for updates in 30 seconds
89+
this.scheduleCheckForUpdates(30 * 1000).then(undefined, err => this.logService.error(err));
90+
}
8691
}
8792

8893
private getProductQuality(updateMode: string): string | undefined {

src/vs/platform/update/node/update.config.contribution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ configurationRegistry.registerConfiguration({
1717
properties: {
1818
'update.mode': {
1919
type: 'string',
20-
enum: ['none', 'manual', 'default'],
20+
enum: ['none', 'manual', 'start', 'default'],
2121
default: 'default',
2222
scope: ConfigurationScope.APPLICATION,
2323
description: localize('updateMode', "Configure whether you receive automatic updates. Requires a restart after change. The updates are fetched from a Microsoft online service."),
2424
tags: ['usesOnlineServices'],
2525
enumDescriptions: [
2626
localize('none', "Disable updates."),
2727
localize('manual', "Disable automatic background update checks. Updates will be available if you manually check for updates."),
28+
localize('start', "Code will check for updates on launch. Disable automatic background update checks. "),
2829
localize('default', "Enable automatic update checks. Code will check for updates automatically and periodically.")
2930
]
3031
},

0 commit comments

Comments
 (0)