提交 f40faced 编写于 作者: S SteVen Batten

fixes #104293

上级 c68d03f5
......@@ -12,6 +12,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag
import { ITelemetryData } from 'vs/base/common/actions';
import { ITASExperimentService } from 'vs/workbench/services/experiment/common/experimentService';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const storageKey = 'VSCode.ABExp.FeatureData';
const refetchInterval = 1000 * 60 * 30; // By default it's set up to 30 minutes.
......@@ -160,13 +161,18 @@ export class ExperimentService implements ITASExperimentService {
private tasClient: Promise<TASClient> | undefined;
private static MEMENTO_ID = 'experiment.service.memento';
private get experimentsEnabled(): boolean {
return this.configurationService.getValue('workbench.enableExperiments') === true;
}
constructor(
@IProductService private productService: IProductService,
@ITelemetryService private telemetryService: ITelemetryService,
@IStorageService private storageService: IStorageService
@IStorageService private storageService: IStorageService,
@IConfigurationService private configurationService: IConfigurationService,
) {
if (this.productService.tasConfig) {
if (this.productService.tasConfig && this.experimentsEnabled) {
this.tasClient = this.setupTASClient();
}
}
......@@ -176,6 +182,10 @@ export class ExperimentService implements ITASExperimentService {
return undefined;
}
if (!this.experimentsEnabled) {
return undefined;
}
return (await this.tasClient).getTreatmentVariable<T>('vscode', name);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册