File size: 357 Bytes
19f7f7b
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/queue/worker.py b/queue/worker.py
--- a/queue/worker.py
+++ b/queue/worker.py
@@ -22,4 +22,5 @@ class CacheWriter:
     def flush(self, batch):
-        for k, v in batch.items():
+        for k, v in list(batch.items()):
             self._cache.set(k, v)
             self._writes_total += 1
+        batch.clear()
         return len(batch)