-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(serverless-hub) retry logic bug #2117
Conversation
@@ -60,7 +60,9 @@ hub.post("/", async (req, res) => { | |||
// Fetch the last block number this given config file queried the blockchain at if running in production. Else, pull from env. | |||
const lastQueriedBlockNumber = await _getLastQueriedBlockNumber(req.body.configFile); | |||
if (!configObject || !lastQueriedBlockNumber) | |||
throw new Error("Serverless hub requires a config object and a last updated block number!"); | |||
throw new Error( | |||
`Serverless hub requires a config object and a last updated block number! configObject:${configObject} lastQueriedBlockNumber:${lastQueriedBlockNumber}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does configObject need to be stringified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure & done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tricky bug , good catch!
Motivation
#2111 yesterday introduced a small bug in the hub wherein by not returning the nested value within the retry logic. The PR has been tested in production with a hot-fix docker container and has been validated to work as expected.
Summary
Adds a
return
to the value retrieved from GCP data store. This PR also expands the error message a bit by showing the underlyingconfigObject
&lastQueriedBlockNumber
returned by the function.