Merge from vscode 52dcb723a39ae75bee1bd56b3312d7fcdc87aeed (#6719)

This commit is contained in:
Anthony Dresser
2019-08-12 21:31:51 -07:00
committed by GitHub
parent 00250839fc
commit 7eba8c4c03
616 changed files with 9472 additions and 7087 deletions

View File

@@ -11,7 +11,7 @@ import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiatio
export class UpdateService implements IUpdateService {
_serviceBrand: ServiceIdentifier<any>;
_serviceBrand!: ServiceIdentifier<any>;
private _onStateChange = new Emitter<State>();
readonly onStateChange: Event<State> = this._onStateChange.event;

View File

@@ -81,8 +81,15 @@ export abstract class AbstractUpdateService implements IUpdateService {
return;
}
// Start checking for updates after 30 seconds
this.scheduleCheckForUpdates(30 * 1000).then(undefined, err => this.logService.error(err));
if (updateMode === 'start') {
this.logService.info('update#ctor - startup checks only; automatic updates are disabled by user preference');
// Check for updates only once after 30 seconds
setTimeout(() => this.checkForUpdates(null), 30 * 1000);
} else {
// Start checking for updates after 30 seconds
this.scheduleCheckForUpdates(30 * 1000).then(undefined, err => this.logService.error(err));
}
}
private getProductQuality(updateMode: string): string | undefined {

View File

@@ -17,7 +17,7 @@ configurationRegistry.registerConfiguration({
properties: {
'update.mode': {
type: 'string',
enum: ['none', 'manual', 'default'],
enum: ['none', 'manual', 'start', 'default'],
default: 'default',
scope: ConfigurationScope.APPLICATION,
description: localize('updateMode', "Configure whether you receive automatic updates. Requires a restart after change. The updates are fetched from a Microsoft online service."),
@@ -25,6 +25,7 @@ configurationRegistry.registerConfiguration({
enumDescriptions: [
localize('none', "Disable updates."),
localize('manual', "Disable automatic background update checks. Updates will be available if you manually check for updates."),
localize('start', "Check for updates only on startup. Disable automatic background update checks."),
localize('default', "Enable automatic update checks. Code will check for updates automatically and periodically.")
]
},