|
@@ -4242,7 +4242,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|
|
|
|
|
|
|
// Respect provider rate limit window
|
|
// Respect provider rate limit window
|
|
|
let rateLimitDelay = 0
|
|
let rateLimitDelay = 0
|
|
|
- const rateLimit = state?.apiConfiguration?.rateLimitSeconds || 0
|
|
|
|
|
|
|
+ const rateLimit = (state?.apiConfiguration ?? this.apiConfiguration)?.rateLimitSeconds || 0
|
|
|
if (Task.lastGlobalApiRequestTime && rateLimit > 0) {
|
|
if (Task.lastGlobalApiRequestTime && rateLimit > 0) {
|
|
|
const elapsed = performance.now() - Task.lastGlobalApiRequestTime
|
|
const elapsed = performance.now() - Task.lastGlobalApiRequestTime
|
|
|
rateLimitDelay = Math.ceil(Math.min(rateLimit, Math.max(0, rateLimit * 1000 - elapsed) / 1000))
|
|
rateLimitDelay = Math.ceil(Math.min(rateLimit, Math.max(0, rateLimit * 1000 - elapsed) / 1000))
|