Skip to content

Commit 6588858

Browse files
authored
Merge pull request #865 from PathwayCommons/indra-more-retries-851
More aggressive Indra retries
2 parents 47c3f16 + 605163b commit 6588858

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/server/routes/api/document/indra.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import { getPubmedCitation } from '../../../../util/pubmed';
1717
const INDRA_STATEMENTS_URL = INDRA_DB_BASE_URL + 'statements/from_agents';
1818
const SORT_BY_DATE = false; // TODO remove
1919

20-
const FETCH_RETRIES = 3;
20+
const FETCH_RETRIES = 20;
2121
const FETCH_RETRY_DELAY = 3000;
22+
const FETCH_RETRY_DELAY_DELTA = 1000;
2223

2324
const SUB_MODIFICATION_TYPES = ['Phosphorylation', 'Dephosphorylation', 'Dephosphorylation',
2425
'Deubiquitination', 'Methylation', 'Demethylation'];
@@ -38,7 +39,7 @@ let sortByDate = SORT_BY_DATE;
3839
const fetchRetry = FetchRetry(fetch);
3940
const fetchRetryUrl = ( url, opts ) => {
4041
let retryOpts = {
41-
retryDelay: FETCH_RETRY_DELAY,
42+
retryDelay: FETCH_RETRY_DELAY + Math.round(Math.random() * FETCH_RETRY_DELAY_DELTA),
4243
retryOn: function( attempt, error, response ) {
4344
// retry on any network error, or 4xx or 5xx status codes
4445
const { statusText, status, ok } = response;

0 commit comments

Comments
 (0)