提交 3aba6f74 编写于 作者: S Sandeep Somavarapu

run sync every 500 ms

上级 09164495
......@@ -23,6 +23,7 @@ import { registerAndGetAmdImageURL } from 'vs/base/common/amd';
import { ResourceContextKey } from 'vs/workbench/common/resources';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { Event } from 'vs/base/common/event';
const CONTEXT_SYNC_STATE = new RawContextKey<string>('syncStatus', SyncStatus.Uninitialized);
......@@ -50,16 +51,14 @@ class UserDataSyncContribution extends Disposable implements IWorkbenchContribut
) {
super();
this.loopSync();
this._register(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('userConfiguration.enableSync') && this.configurationService.getValue<boolean>('userConfiguration.enableSync')) {
this.sync();
}
}));
this._register(Event.filter(this.configurationService.onDidChangeConfiguration,
e => e.affectsConfiguration('userConfiguration.enableSync') && this.configurationService.getValue<boolean>('userConfiguration.enableSync'))
(() => this.sync()));
}
private loopSync(): void {
this.sync()
.then(() => timeout(1000 * 60 * 5)) // every five minutes
.then(() => timeout(500))
.then(() => this.loopSync());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册