Skip to content

Commit e498b4f

Browse files
committed
Finally prevent parallel syncing
1 parent dacf86a commit e498b4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/Account.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ export default class Account {
125125

126126
async sync () {
127127
try {
128-
if (this.getData().syncing) return
128+
if (this.getData().syncing || this.syncing) return
129129
console.log('Starting sync process for account ' + this.getLabel())
130+
this.syncing = true
130131
await this.setData({...this.getData(), syncing: true})
131132
if (!(await this.isInitialized())) {
132133
await this.init()
@@ -161,6 +162,7 @@ export default class Account {
161162
await this.tree.removeOrphanedFolders()
162163

163164
await this.setData({...this.getData(), error: null, syncing: false, lastSync: Date.now()})
165+
this.syncing = false
164166
console.log('Successfully ended sync process for account ' + this.getLabel())
165167
} catch (e) {
166168
if (e.list) {

0 commit comments

Comments
 (0)