Skip to content

Commit

Permalink
fix: better attempts at image download (#94)
Browse files Browse the repository at this point in the history
* fix: wait longer before retrying image download

* increase attempts
  • Loading branch information
Alex Plischke authored Jun 25, 2024
1 parent d9aee80 commit d654368
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/llm/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export async function downloadImage(
accessKey: string,
storage: GlobalStorage,
) {
for (let attempt = 0; attempt < 10; attempt++) {
for (let attempt = 0; attempt < 15; attempt++) {
if (attempt > 0) {
console.log('Retrying image download...');
await new Promise((f) => setTimeout(f, 1000));
await new Promise((f) => setTimeout(f, 3000));
}
try {
const response = await fetch(imgURL, {
Expand Down

0 comments on commit d654368

Please sign in to comment.