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:
@@ -2626,7 +2626,7 @@ namespace URLNotesGrabberCORE
|
|||||||
{
|
{
|
||||||
minRetrySeconds = 0;
|
minRetrySeconds = 0;
|
||||||
if (!_usePool || _overrideKey != null) return false;
|
if (!_usePool || _overrideKey != null) return false;
|
||||||
if (_keys.Count <= 1) return true;
|
if (_keys.Count == 0) return false;
|
||||||
|
|
||||||
var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||||
bool all = true;
|
bool all = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user