fixes #133582
This commit is contained in:
parent
0c3d2cf590
commit
8dae395177
|
@ -72,7 +72,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
|||
return;
|
||||
}
|
||||
|
||||
const updateMode = getMigratedSettingValue<string>(this.configurationService, 'update.mode', 'update.channel');
|
||||
const updateMode = this.getUpdateMode();
|
||||
const quality = this.getProductQuality(updateMode);
|
||||
|
||||
if (!quality) {
|
||||
|
@ -104,6 +104,10 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
|||
}
|
||||
}
|
||||
|
||||
private getUpdateMode(): 'none' | 'manual' | 'start' | 'default' {
|
||||
return getMigratedSettingValue<'none' | 'manual' | 'start' | 'default'>(this.configurationService, 'update.mode', 'update.channel');
|
||||
}
|
||||
|
||||
private getProductQuality(updateMode: string): string | undefined {
|
||||
return updateMode === 'none' ? undefined : this.productService.quality;
|
||||
}
|
||||
|
@ -177,20 +181,18 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
|||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
isLatestVersion(): Promise<boolean | undefined> {
|
||||
async isLatestVersion(): Promise<boolean | undefined> {
|
||||
if (!this.url) {
|
||||
return Promise.resolve(undefined);
|
||||
return undefined;
|
||||
} else if (this.getUpdateMode() === 'none') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.requestService.request({ url: this.url }, CancellationToken.None).then(context => {
|
||||
// The update server replies with 204 (No Content) when no
|
||||
// update is available - that's all we want to know.
|
||||
if (context.res.statusCode === 204) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
const context = await this.requestService.request({ url: this.url }, CancellationToken.None);
|
||||
|
||||
// The update server replies with 204 (No Content) when no
|
||||
// update is available - that's all we want to know.
|
||||
return context.res.statusCode === 204;
|
||||
}
|
||||
|
||||
protected getUpdateType(): UpdateType {
|
||||
|
|
Loading…
Reference in a new issue