fix(download): honor retry and queue limits

Treat max_tries as the configured retry count instead of total attempts across native, media, aria2, and fallback paths.

Route queue slot acquisition through retirement-aware permit handling so shrinking concurrency does not dispatch new work while active transfers still meet the smaller limit.

Update retry-budget and queue-manager tests to cover the corrected attempt counts and paused aria2 resume behavior.
This commit is contained in:
NimBold
2026-07-02 01:58:30 +03:30
parent 6b7eaa1f66
commit 1e61d05873
5 changed files with 110 additions and 64 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ async fn reports_terminal_http_errors_after_retry_budget() {
};
assert!(error.contains("500 Internal Server Error"));
assert_eq!(server.state.requests.load(Ordering::SeqCst), 2);
assert_eq!(server.state.requests.load(Ordering::SeqCst), 3);
assert!(!output_path.exists());
}