@@ -6,6 +6,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'
66import { AbstractStorageService , IStorageService , StorageScope as VSStorageScope } from 'vs/platform/storage/common/storage'
77import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'
88import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'
9+ import { registerServiceInitializePreParticipant } from '../services'
910
1011export 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+
120127export default function getStorageServiceOverride ( provider : IStorageProvider ) : IEditorOverrideServices {
121128 return {
122129 [ IStorageService . toString ( ) ] : new SyncDescriptor ( ExternalStorageService , [ provider ] , true )
0 commit comments