forked from kahst/BirdNET-Lite
-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Threaded BirdWeather submissions with retry support
Run BirdWeather submissions in a separate thread to run in the background it doesn't hold up or slow down processing audio and detection's. Instead of creating a new thread to process each Birdweather submission as they occur, add the data used for the Birdweather submission to a queue. Then use a single thread running birdweather_submission_processor in a endless loop to process Birdweather submissions as they are added to that queue. This avoids accidentally sending too many Birdweather submission at once, so we're only ever sending 1 submission at any one time. Add timeout values to the requests as they will run indefinitely if no timeout is specified Further, the ability to retry requests was implemented but only for connection timeouts and specific responses codes that can be retried on. A exponential backoff delay is calculated before retrying again to provide adequate delay between requests and ease server pressure
- Loading branch information
Showing
1 changed file
with
265 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters