Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
Rename function and reference curl option.
  • Loading branch information
caugner authored Jan 24, 2025
1 parent 7846bbd commit 798af20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ import { handleRunner } from "../libs/play/index.js";
async function fetch_from_rari(path: string) {
const external_url = `${EXTERNAL_DEV_SERVER}${path}`;
console.log(`using ${external_url}`);
const response = await fetchRetryIfRefused(external_url, 5);
const response = await fetchWithRetryIfConnRefused(external_url, 5);
return await response.json();
}

async function fetchRetryIfRefused(
// Simulates `curl --retry-connrefused`.
async function fetchWithRetryIfConnRefused(
url: string,
maxRetries: number,
baseDelay = 1000
Expand Down

0 comments on commit 798af20

Please sign in to comment.