mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 01:25:39 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -40,47 +40,52 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
||||
}
|
||||
|
||||
constructor(
|
||||
@ILifecycleService private lifecycleService: ILifecycleService,
|
||||
@ILifecycleService private readonly lifecycleService: ILifecycleService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService,
|
||||
@IEnvironmentService private environmentService: IEnvironmentService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@IRequestService protected requestService: IRequestService,
|
||||
@ILogService protected logService: ILogService,
|
||||
) {
|
||||
if (this.environmentService.disableUpdates) {
|
||||
this.logService.info('update#ctor - updates are disabled');
|
||||
this.logService.info('update#ctor - updates are disabled by the environment');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!product.updateUrl || !product.commit) {
|
||||
this.logService.info('update#ctor - updates are disabled');
|
||||
this.logService.info('update#ctor - updates are disabled as there is no update URL');
|
||||
return;
|
||||
}
|
||||
|
||||
const quality = this.getProductQuality();
|
||||
const updateChannel = this.configurationService.getValue<string>('update.channel');
|
||||
const quality = this.getProductQuality(updateChannel);
|
||||
|
||||
if (!quality) {
|
||||
this.logService.info('update#ctor - updates are disabled');
|
||||
this.logService.info('update#ctor - updates are disabled by user preference');
|
||||
return;
|
||||
}
|
||||
|
||||
this.url = this.buildUpdateFeedUrl(quality);
|
||||
if (!this.url) {
|
||||
this.logService.info('update#ctor - updates are disabled');
|
||||
this.logService.info('update#ctor - updates are disabled as the update URL is badly formed');
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState(State.Idle(this.getUpdateType()));
|
||||
|
||||
if (updateChannel === 'manual') {
|
||||
this.logService.info('update#ctor - manual checks only; automatic updates are disabled by user preference');
|
||||
return;
|
||||
}
|
||||
|
||||
// Start checking for updates after 30 seconds
|
||||
this.scheduleCheckForUpdates(30 * 1000).then(undefined, err => this.logService.error(err));
|
||||
}
|
||||
|
||||
private getProductQuality(): string | undefined {
|
||||
const quality = this.configurationService.getValue<string>('update.channel');
|
||||
return quality === 'none' ? undefined : product.quality;
|
||||
private getProductQuality(updateChannel: string): string | undefined {
|
||||
return updateChannel === 'none' ? undefined : product.quality;
|
||||
}
|
||||
|
||||
private scheduleCheckForUpdates(delay = 60 * 60 * 1000): Thenable<void> {
|
||||
private scheduleCheckForUpdates(delay = 60 * 60 * 1000): Promise<void> {
|
||||
return timeout(delay)
|
||||
.then(() => this.checkForUpdates(null))
|
||||
.then(() => {
|
||||
@@ -127,11 +132,11 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
||||
// noop
|
||||
}
|
||||
|
||||
quitAndInstall(): Thenable<void> {
|
||||
quitAndInstall(): Promise<void> {
|
||||
this.logService.trace('update#quitAndInstall, state = ', this.state.type);
|
||||
|
||||
if (this.state.type !== StateType.Ready) {
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
this.logService.trace('update#quitAndInstall(): before lifecycle quit()');
|
||||
@@ -146,10 +151,10 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
||||
this.doQuitAndInstall();
|
||||
});
|
||||
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
isLatestVersion(): Thenable<boolean | undefined> {
|
||||
isLatestVersion(): Promise<boolean | undefined> {
|
||||
if (!this.url) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user