mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Make state service async (#122977)
* state service - make it electron-main only * state service - make writes async * some cleanup * more cleanup and removal of sync fs
This commit is contained in:
@@ -23,7 +23,7 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { ILoggerService, ILogService } from 'vs/platform/log/common/log';
|
||||
import { IStateService } from 'vs/platform/state/node/state';
|
||||
import { IStateMainService } from 'vs/platform/state/electron-main/state';
|
||||
import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IOpenURLOptions, IURLService } from 'vs/platform/url/common/url';
|
||||
@@ -107,7 +107,7 @@ export class CodeApplication extends Disposable {
|
||||
@IEnvironmentMainService private readonly environmentMainService: IEnvironmentMainService,
|
||||
@ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IStateService private readonly stateService: IStateService,
|
||||
@IStateMainService private readonly stateMainService: IStateMainService,
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@IProductService private readonly productService: IProductService
|
||||
) {
|
||||
@@ -458,11 +458,11 @@ export class CodeApplication extends Disposable {
|
||||
|
||||
// We cache the machineId for faster lookups on startup
|
||||
// and resolve it only once initially if not cached or we need to replace the macOS iBridge device
|
||||
let machineId = this.stateService.getItem<string>(machineIdKey);
|
||||
let machineId = this.stateMainService.getItem<string>(machineIdKey);
|
||||
if (!machineId || (isMacintosh && machineId === '6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead')) {
|
||||
machineId = await getMachineId();
|
||||
|
||||
this.stateService.setItem(machineIdKey, machineId);
|
||||
this.stateMainService.setItem(machineIdKey, machineId);
|
||||
}
|
||||
|
||||
return machineId;
|
||||
|
||||
Reference in New Issue
Block a user