Skip to content

Commit

Permalink
fix: #5
Browse files Browse the repository at this point in the history
  • Loading branch information
krhougs committed May 20, 2021
1 parent 0e224e8 commit dd50f33
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"finity": "^0.5.4",
"ioredis": "^4.27.2",
"node-fetch": "^2.6.1",
"ottoman": "^2.0.0-alpha.28",
"ottoman": "^2.0.0-alpha.29",
"p-queue": "^6.6.2",
"protobufjs": "^6.11.2",
"redis-commands": "^1.7.0",
Expand Down
21 changes: 10 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/fetch/sync_block.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ const tryGetBlockExistence = (BlockModel, number) => {
.then((i) => !!i)
.catch((e) => {
if (e.message === 'path exists') {
$logger.warn('Index not found, retrying in 10s...')
$logger.warn('Index not found, retrying in 10s...', { number })
return wait(10000).then(() => tryGetBlockExistence(BlockModel, number))
}
if (e.message === 'timeout') {
$logger.warn('tryGetBlockExistence timed out, retrying in 1.5s...', { number })
return wait(1500).then(() => tryGetBlockExistence(BlockModel, number))
}
$logger.error('tryGetBlockExistence', e, { number })
process.exit(-2)
})
Expand Down

0 comments on commit dd50f33

Please sign in to comment.