We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f4fad8 commit 4964d80Copy full SHA for 4964d80
src/amplitude/worker.py
@@ -38,11 +38,11 @@ def stop(self):
38
def flush(self):
39
futures = []
40
with self.storage.lock:
41
- while self.storage.total_events:
+ while True:
42
events = self.storage.pull(self.configuration.flush_queue_size)
43
- if events:
44
- future = self.threads_pool.submit(self.send, events)
45
- futures.append(future)
+ if not events:
+ break
+ futures.append(self.threads_pool.submit(self.send, events))
46
return futures
47
48
def send(self, events):
0 commit comments