提交 20b49a4a 编写于 作者: B Benjamin Pasero

storage - more target adoption (#109967)

上级 d9893b5d
......@@ -68,7 +68,7 @@ export class ContributedCustomEditors extends Disposable {
}
}
const mementoObject = this._memento.legacygetMemento(StorageScope.GLOBAL);
const mementoObject = this._memento.getMemento(StorageScope.GLOBAL, StorageTarget.MACHINE);
mementoObject[ContributedCustomEditors.CUSTOM_EDITORS_ENTRY_ID] = Array.from(this._editors.values());
this._memento.saveMemento();
......
......@@ -280,7 +280,7 @@ export class ExperimentService extends Disposable implements IExperimentService
});
}
if (enabledExperiments.length) {
this.storageService.store('allExperiments', JSON.stringify(enabledExperiments), StorageScope.GLOBAL);
this.storageService.store2('allExperiments', JSON.stringify(enabledExperiments), StorageScope.GLOBAL, StorageTarget.MACHINE);
} else {
this.storageService.remove('allExperiments', StorageScope.GLOBAL);
}
......@@ -350,7 +350,7 @@ export class ExperimentService extends Disposable implements IExperimentService
return this.shouldRunExperiment(experiment, processedExperiment).then((state: ExperimentState) => {
experimentState.state = processedExperiment.state = state;
this.storageService.store(storageKey, JSON.stringify(experimentState), StorageScope.GLOBAL);
this.storageService.store2(storageKey, JSON.stringify(experimentState), StorageScope.GLOBAL, StorageTarget.MACHINE);
if (state === ExperimentState.Run) {
this.fireRunExperiment(processedExperiment);
......@@ -370,7 +370,7 @@ export class ExperimentService extends Disposable implements IExperimentService
// Ensure we dont store duplicates
const distinctExperiments = distinct(runExperimentIdsFromStorage);
if (runExperimentIdsFromStorage.length !== distinctExperiments.length) {
this.storageService.store('currentOrPreviouslyRunExperiments', JSON.stringify(distinctExperiments), StorageScope.GLOBAL);
this.storageService.store2('currentOrPreviouslyRunExperiments', JSON.stringify(distinctExperiments), StorageScope.GLOBAL, StorageTarget.MACHINE);
}
}
......@@ -399,7 +399,7 @@ export class ExperimentService extends Disposable implements IExperimentService
const key = experimentEventStorageKey(event);
const record = getCurrentActivationRecord(safeParse(this.storageService.get(key, StorageScope.GLOBAL), undefined));
record.count[0]++;
this.storageService.store(key, JSON.stringify(record), StorageScope.GLOBAL);
this.storageService.store2(key, JSON.stringify(record), StorageScope.GLOBAL, StorageTarget.MACHINE);
this._experiments
.filter(e => e.state === ExperimentState.Evaluating && e.raw?.condition?.activationEvent?.event === event)
......@@ -558,12 +558,12 @@ export class ExperimentService extends Disposable implements IExperimentService
if (filePathCheck && workspaceCheck) {
latestExperimentState.editCount = (latestExperimentState.editCount || 0) + 1;
latestExperimentState.lastEditedDate = date;
this.storageService.store(storageKey, JSON.stringify(latestExperimentState), StorageScope.GLOBAL);
this.storageService.store2(storageKey, JSON.stringify(latestExperimentState), StorageScope.GLOBAL, StorageTarget.MACHINE);
}
});
if (typeof latestExperimentState.editCount === 'number' && latestExperimentState.editCount >= fileEdits.minEditCount) {
processedExperiment.state = latestExperimentState.state = (typeof condition.userProbability === 'number' && Math.random() < condition.userProbability && this.checkExperimentDependencies(experiment)) ? ExperimentState.Run : ExperimentState.NoRun;
this.storageService.store(storageKey, JSON.stringify(latestExperimentState), StorageScope.GLOBAL);
this.storageService.store2(storageKey, JSON.stringify(latestExperimentState), StorageScope.GLOBAL, StorageTarget.MACHINE);
if (latestExperimentState.state === ExperimentState.Run && processedExperiment.action && ExperimentActionType[processedExperiment.action.type] === ExperimentActionType.Prompt) {
this.fireRunExperiment(processedExperiment);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册