Skip to content

Commit 921db9e

Browse files
authored
reduce the settings sync debounce to 3s (microsoft#239219)
1 parent 8d04e1b commit 921db9e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vs/platform/userDataSync/common/userDataAutoSyncService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto
333333
return this.syncTriggerDelayer.cancel();
334334
}
335335

336-
if (options?.skipIfSyncedRecently && this.lastSyncTriggerTime && new Date().getTime() - this.lastSyncTriggerTime < 15_000) {
336+
if (options?.skipIfSyncedRecently && this.lastSyncTriggerTime && new Date().getTime() - this.lastSyncTriggerTime < 10_000) {
337337
this.logService.debug('[AutoSync] Skipping because sync was triggered recently.', sources);
338338
return;
339339
}
@@ -352,11 +352,11 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto
352352
}
353353

354354
protected getSyncTriggerDelayTime(): number {
355-
if (this.lastSyncTriggerTime && new Date().getTime() - this.lastSyncTriggerTime > 15_000) {
356-
this.logService.debug('[AutoSync] Sync immediately because last sync was triggered more than 15 seconds ago.');
355+
if (this.lastSyncTriggerTime && new Date().getTime() - this.lastSyncTriggerTime > 10_000) {
356+
this.logService.debug('[AutoSync] Sync immediately because last sync was triggered more than 10 seconds ago.');
357357
return 0;
358358
}
359-
return 10_000; /* Debounce for 10 seconds if there are no failures */
359+
return 3_000; /* Debounce for 3 seconds if there are no failures */
360360
}
361361

362362
}

0 commit comments

Comments
 (0)