Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-02-15 17:55:16 +0300
committerRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-02-15 17:55:16 +0300
commiteeaf7512e1f83c598b86b61a2737747fab2fd2e3 (patch)
tree2ac8e9d5a6ce9f0b4cf50e5798e9f7f705522628 /src/models
parent4ba532414e6f20af2b1bd2514281cb605162e180 (diff)
Only allow one update request to a task at the same time
Diffstat (limited to 'src/models')
-rw-r--r--src/models/task.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/models/task.js b/src/models/task.js
index 09de124c..ef6686c7 100644
--- a/src/models/task.js
+++ b/src/models/task.js
@@ -24,6 +24,7 @@
import uuid from 'uuid'
import ICAL from 'ical.js'
+import PQueue from 'p-queue'
export default class Task {
@@ -57,6 +58,11 @@ export default class Task {
this.initTodo()
this.syncstatus = null
+
+ // Queue for update requests with concurrency 1,
+ // because we only want to allow one request at a time
+ // (otherwise we will run into problems with changed ETags).
+ this.updateQueue = new PQueue({ concurrency: 1 })
}
initTodo() {