Skip to content

Commit 27f09b1

Browse files
author
Loïc Mangeonjean
committed
fix: initialize storage service
1 parent 512271a commit 27f09b1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/service-override/storage.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'
66
import { AbstractStorageService, IStorageService, StorageScope as VSStorageScope } from 'vs/platform/storage/common/storage'
77
import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'
88
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'
9+
import { registerServiceInitializePreParticipant } from '../services'
910

1011
export enum StorageScope {
1112
APPLICATION = VSStorageScope.APPLICATION,
@@ -71,7 +72,9 @@ class ExternalStorageService extends AbstractStorageService {
7172
private readonly workspaceStorage = this._register(new ExternalStorage(StorageScope.WORKSPACE, this.provider))
7273

7374
constructor (protected readonly provider: IStorageProvider) {
74-
super()
75+
super({
76+
flushInterval: 5000
77+
})
7578

7679
this._register(this.workspaceStorage.onDidChangeStorage(key => this.emitDidChangeValue(VSStorageScope.WORKSPACE, key)))
7780
this._register(this.profileStorage.onDidChangeStorage(key => this.emitDidChangeValue(VSStorageScope.PROFILE, key)))
@@ -117,6 +120,10 @@ class ExternalStorageService extends AbstractStorageService {
117120
}
118121
}
119122

123+
registerServiceInitializePreParticipant(async (accessor) => {
124+
await (accessor.get(IStorageService) as ExternalStorageService).initialize()
125+
})
126+
120127
export default function getStorageServiceOverride (provider: IStorageProvider): IEditorOverrideServices {
121128
return {
122129
[IStorageService.toString()]: new SyncDescriptor(ExternalStorageService, [provider], true)

0 commit comments

Comments
 (0)