Skip to content

Commit 2dbcdaf

Browse files
siosonelvivekavuthu
authored andcommitted
inject mayLog as a helper in initGenomesDs()
1 parent 6a8f66a commit 2dbcdaf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/src/initGenomesDs.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { clinsig } from '../dataset/clinvar.ts'
1313
// will pass below as argument to mds3_init()
1414
import { mayMapRefseq2ensembl, flattenCaseByFields, may_add_readdepth, mapGenes2isoforms } from './mds3.gdc.js'
1515
import { isUsableTerm, joinUrl, ezFetch } from '@sjcrh/proteinpaint-shared'
16+
import { mayLog } from './helpers.ts'
1617

1718
const dsHelpers = {
1819
mayMapRefseq2ensembl,
@@ -23,7 +24,8 @@ const dsHelpers = {
2324
joinUrl,
2425
ezFetch,
2526
xfetch: utils.xfetch,
26-
cachedFetch: utils.cachedFetch
27+
cachedFetch: utils.cachedFetch,
28+
mayLog
2729
}
2830

2931
export const genomes = {} // { hg19: {...}, ... }
@@ -541,7 +543,11 @@ function mayRetryInit(g, ds, d, e) {
541543
)
542544
}
543545
} else {
544-
console.warn(`${gdlabel} init() failed. Retrying... (${ds.init.retryMax - currentRetry} attempts left)`)
546+
console.warn(
547+
`${gdlabel} init() failed. Retrying in ${Math.round(ds.init.retryDelay / 1000)} second(s) ... (${
548+
ds.init.retryMax - currentRetry
549+
} attempts left)`
550+
)
545551
if (currentRetry >= ds.init.retryMax) {
546552
clearInterval(interval) // cancel retries
547553
const msg = `Max retry attempts for ${gdlabel} reached. Failing with error:`

0 commit comments

Comments
 (0)