mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 19:26:55 +08:00
Fix accounts syncing in a hard loop due to redis loopback
This commit is contained in:
parent
13a723e663
commit
ac3f96e2d4
1 changed files with 6 additions and 3 deletions
|
@ -73,11 +73,14 @@ class SyncWorker {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onAccountUpdated() {
|
_onAccountUpdated() {
|
||||||
if (!this.isWaitingForNextSync()) {
|
const syncingNow = !this.isWaitingForNextSync()
|
||||||
|
const syncingJustFinished = (Date.now() - this._lastSyncTime < 5000);
|
||||||
|
|
||||||
|
if (syncingNow || syncingJustFinished) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._getAccount()
|
|
||||||
.then((account) => {
|
this._getAccount().then((account) => {
|
||||||
this._account = account;
|
this._account = account;
|
||||||
this.syncNow({reason: 'Account Modification'});
|
this.syncNow({reason: 'Account Modification'});
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue