Skip to content

Commit

Permalink
double interval between fetch
Browse files Browse the repository at this point in the history
instead of increasing
  • Loading branch information
nleanba committed Mar 26, 2024
1 parent 198f009 commit 46b1a33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions SynonymGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,10 @@ export class SparqlEndpoint {
} catch (error) {
if (fetchOptions.signal?.aborted) {
throw error;
} else if (retryCount < 5) {
++retryCount;
console.warn(
`!! Fetch Error. Retrying in ${retryCount * 50}ms (${retryCount})`,
);
await sleep(retryCount * 50);
} else if (retryCount < 10) {
const wait = 50 * (1 << retryCount++);
console.warn(`!! Fetch Error. Retrying in ${wait}ms (${retryCount})`);
await sleep(wait);
return await sendRequest();
}
console.warn("!! Fetch Error:", query, "\n---\n", error);
Expand Down
2 changes: 1 addition & 1 deletion npm-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@factsmission/synogroup",
"version": "2.0.1",
"version": "2.0.2",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 46b1a33

Please sign in to comment.