Skip to content
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

Merged
merged 4 commits into from
Oct 28, 2020
Merged

Conversation

chrismaree
Copy link
Member

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 underlying configObject & lastQueriedBlockNumber returned by the function.

@coveralls
Copy link

coveralls commented Oct 27, 2020

Coverage Status

Coverage remained the same at 93.829% when pulling 1486590 on chrismaree/patch-serverless-hub into 3e6051b on master.

@@ -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}`
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure & done.

Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
Copy link
Member

@nicholaspai nicholaspai left a 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!

@chrismaree chrismaree merged commit 8a6a541 into master Oct 28, 2020
@chrismaree chrismaree deleted the chrismaree/patch-serverless-hub branch October 28, 2020 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants