Skip to content

Commit 8cc484f

Browse files
fix: fix request delays for retrying to be more respectful of high requested delays
1 parent 2543278 commit 8cc484f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,9 @@ export class ImageKit {
667667
}
668668
}
669669

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

0 commit comments

Comments
 (0)