fix: correctly detect rate-limit state for single-key API pools

IsAllRateLimited() short-circuited true for any pool with 0 or 1
keys, with minRetrySeconds left at 0 regardless of whether that key
was actually rate-limited. SleepUntilAnyAvailable() checks
"minRetry <= 0" to decide whether to skip sleeping, so with exactly
one key it always skipped the wait and let callers hammer the API
again immediately after a 429, even mid-cooldown.

The per-key loop already computes this correctly for any key count;
the special case only needs to cover the true no-keys edge case,
where there's nothing to wait on.
This commit is contained in:
jim
2026-06-30 21:22:12 -05:00
parent f549f020e1
commit f541ec4260
+1 -1
View File
@@ -2626,7 +2626,7 @@ namespace URLNotesGrabberCORE
{
minRetrySeconds = 0;
if (!_usePool || _overrideKey != null) return false;
if (_keys.Count <= 1) return true;
if (_keys.Count == 0) return false;
var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
bool all = true;