From 93875818f5df526f2f0cc234f46ea634c5529940 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 28 Mar 2025 16:21:11 -0700 Subject: [PATCH] enable auto updates --- .../electron-main/abstractUpdateService.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts index f1cb2852..417d8fc1 100644 --- a/src/vs/platform/update/electron-main/abstractUpdateService.ts +++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // import { timeout } from '../../../base/common/async.js'; +import { timeout } from '../../../base/common/async.js'; import { CancellationToken } from '../../../base/common/cancellation.js'; import { Emitter, Event } from '../../../base/common/event.js'; import { IConfigurationService } from '../../configuration/common/configuration.js'; @@ -19,7 +20,8 @@ import { Architecture, AvailableForDownload, DisablementReason, IUpdateService, export function createUpdateURL(productService: IProductService, quality: string, platform: Platform, architecture: Architecture, target?: Target): string { // return `https://voideditor.dev/api/update/${platform}/stable`; if (target) { return `${productService.updateUrl}/${quality}/${platform}/${architecture}/${target}/latest.json`; - } else { + } else { // we shouldn't usually have a target: + // https://raw.githubusercontent.com/voideditor/versions/refs/heads/main/stable/darwin/arm64/latest.json return `${productService.updateUrl}/${quality}/${platform}/${architecture}/latest.json`; } } @@ -83,22 +85,20 @@ export abstract class AbstractUpdateService implements IUpdateService { return; } - this.setState(State.Disabled(DisablementReason.ManuallyDisabled)); + // Void - re-enabled auto updates + // this.setState(State.Disabled(DisablementReason.ManuallyDisabled)); - - // Void - temporarily disabled while we figure out how to do this the right way - - // this.setState(State.Idle(this.getUpdateType())); + this.setState(State.Idle(this.getUpdateType())); // start checking for updates after 10 seconds - // this.scheduleCheckForUpdates(10 * 1000).then(undefined, err => this.logService.error(err)); + this.scheduleCheckForUpdates(10 * 1000).then(undefined, err => this.logService.error(err)); } - // private async scheduleCheckForUpdates(delay = 60 * 60 * 1000): Promise { - // await timeout(delay); - // await this.checkForUpdates(false); - // return await this.scheduleCheckForUpdates(60 * 60 * 1000); - // } + private async scheduleCheckForUpdates(delay = 60 * 60 * 1000): Promise { + await timeout(delay); + await this.checkForUpdates(false); + return await this.scheduleCheckForUpdates(60 * 60 * 1000); + } async checkForUpdates(explicit: boolean): Promise { this.logService.trace('update#checkForUpdates, state = ', this.state.type);