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 848b1a5Copy full SHA for 848b1a5
src/amplitude/worker.py
@@ -38,11 +38,12 @@ 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
+ future = self.threads_pool.submit(self.send, events)
46
+ futures.append(future)
47
return futures
48
49
def send(self, events):
0 commit comments