Amplitude-Python
Amplitude-Python copied to clipboard
fix: Respect flush_queue_size when calling Workers.flush
Summary
Currently Workers.flush doesn't respect flush_queue_size which can cause a large number of events to be sent to Amplitude when this method is called. This can then trigger errors such as 413 (Content Too Large). The change here updates the method to send the data in batches according to flush_queue_size in order to prevent this.
This modifies the return type of Workers.flush from Future to List[Future] which I believe only impacts the behavior in Timeline.flush but I could be wrong there.
Checklist
- [x] Does your PR title have the correct title format?
- Does your PR have a breaking change?: Hopefully not