Skip to content

Commit 5399979

Browse files
fix: fix request delays for retrying to be more respectful of high requested delays
1 parent 11dad21 commit 5399979

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,9 @@ export class Perplexity {
583583
}
584584
}
585585

586-
// If the API asks us to wait a certain amount of time (and it's a reasonable amount),
587-
// just do what it says, but otherwise calculate a default
588-
if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
586+
// If the API asks us to wait a certain amount of time, just do what it
587+
// says, but otherwise calculate a default
588+
if (timeoutMillis === undefined) {
589589
const maxRetries = options.maxRetries ?? this.maxRetries;
590590
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
591591
}

0 commit comments

Comments
 (0)