mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 02:58:31 -05:00
Merge from vscode ad407028575a77ea387eb7cc219b323dc017b686
This commit is contained in:
committed by
Anthony Dresser
parent
404260b8a0
commit
4ad73d381c
@@ -12,9 +12,10 @@ 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.
|
||||
const refetchInterval = 0; // no polling
|
||||
|
||||
class MementoKeyValueStorage implements IKeyValueStorage {
|
||||
constructor(private mementoObj: MementoObject) { }
|
||||
@@ -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.telemetryService.isOptedIn) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user