791
792
private async _runUpdateCheck(): Promise<void> {
794
>
795
>
try {
796
>
const installed = this.installedPlugins.get();
797
>
if (installed.length === 0) {
798
return;
799
}
801
>
const seenMarketplaces = new Set<string>();
802
>
let hasUpdates = false;
803
>
804
>
for (const entry of installed) {
805
>
const ref = entry.plugin.marketplaceReference;
806
>
if (seenMarketplaces.has(ref.canonicalId)) {
807
continue;
808
}
810
>
811
>
try {
812
>
const behind = await this._pluginRepositoryService.fetchRepository(ref);
813
if (behind) {
814
hasUpdates = true;
815
break;
816
}
818
>
this._logService.debug(`[PluginMarketplaceService] Update check failed for ${ref.displayLabel}:`, err);
819
>
}
820
>
}
821
>
822
>
this._hasUpdatesAvailable.set(hasUpdates, undefined);
823
>
this._storageService.store(
824
>
PLUGIN_UPDATE_LAST_CHECK_STORAGE_KEY,
825
>
Date.now(),
826
>
StorageScope.APPLICATION,
827
>
StorageTarget.MACHINE,
828
>
);
829
>
} catch (err) {
830
this._logService.debug('[PluginMarketplaceService] Periodic update check failed:', err);
832
>
// Reschedule for the next check
833
>
if (this._isAutoUpdateEnabled()) {
834
>
this._updateCheckTimer = setTimeout(() => this._runUpdateCheck(), PLUGIN_UPDATE_CHECK_INTERVAL_MS);
835
>
}
836
>
}
837
>
}
838
839
private async _fetchFromClonedRepo(reference: IMarketplaceReference, token: CancellationToken): Promise<IMarketplacePlugin[]> {