feat(athenad): priority uploads (#34856)
Today, Firehose uploads and user-requested uploads from Connect are treated the same. This is not ideal behavior if the user wants to upload routes immediately for a bug report and the queue is full of uploads for Firehose. The workaround is to clear the queue and retry the upload from Connect. This PR adds an optional `priority` to requested file uploads in `athenad`. By default, all requests are marked `Low`. However, if the caller wishes to mark their uploads as "more important," then the upload queue will prioritize those requests when uploading. The only caveat to this PR is that we won't reorder files currently being uploaded. Most connections are quick enough to finish uploading max 4 files before polling the new high-priority items in the queue. Closes https://github.com/commaai/openpilot/issues/34836 **Verification** Added test case to insert upload tasks with differing priorities. Polling the queue produces items in the correct order (smallest # to largest). PR to mark Connect uploads as high priority: https://github.com/commaai/connect/pull/557 --------- Co-authored-by: Cameron Clough <cameronjclough@gmail.com>pull/34908/head
parent
2fca845153
commit
e785026a98
2 changed files with 40 additions and 5 deletions
Loading…
Reference in new issue