mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 03:23:45 +08:00
Fix scenario where sync worker is re-assigned the same account before fully releasing it
This commit is contained in:
parent
3e8623d383
commit
e89975456b
2 changed files with 3 additions and 1 deletions
|
@ -194,13 +194,14 @@ class SyncProcessManager {
|
|||
const dst = ACCOUNTS_UNCLAIMED;
|
||||
|
||||
return PubsubConnector.broadcastClient().lremAsync(src, 1, accountId).then((didRemove) => {
|
||||
this._workers[accountId] = null;
|
||||
|
||||
if (didRemove) {
|
||||
PubsubConnector.broadcastClient().rpushAsync(dst, accountId)
|
||||
} else {
|
||||
this._logger.error("Wanted to return item to pool, but didn't have claim on it.")
|
||||
return
|
||||
}
|
||||
this._workers[accountId] = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,6 +225,7 @@ class SyncWorker {
|
|||
|
||||
this._account.lastSyncCompletions = lastSyncCompletions
|
||||
this._account.save()
|
||||
|
||||
this._logger.info('Syncworker: Completed sync cycle')
|
||||
|
||||
if (afterSync === 'idle') {
|
||||
|
|
Loading…
Reference in a new issue