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

Handle 404 during validator calls by skipping campaign #157

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

simzzz
Copy link
Contributor

@simzzz simzzz commented Aug 27, 2020

fixes #148

@simzzz simzzz requested review from Ivshti and rori4 August 27, 2020 16:08
@Ivshti Ivshti requested review from ivopaunov and removed request for Ivshti August 28, 2020 13:16
@Ivshti
Copy link
Member

Ivshti commented Aug 28, 2020

@ivopaunov @rori4 can you review this?

let dataLeader
let dataFollower
let dataLatestNewState
try {
Copy link
Member

Choose a reason for hiding this comment

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

Can't you use await Promise.all([...]) inside try catch or Promise.all([ ... ].map(pr => pr.catch(...))). You can detect the the failed request but they will be send in parallel.

Copy link
Member

@ivopaunov ivopaunov left a comment

Choose a reason for hiding this comment

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

make it with Promise.all at handleValidatorCalls

let dataLeader
let dataFollower
let dataLatestNewState
try {
dataLeader = await getRequest(leaderUrl)
;[dataLeader, dataFollower, dataLatestNewState] = await Promise.all([
Copy link
Member

Choose a reason for hiding this comment

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

remove the semicolon and log the catch error

@Ivshti Ivshti force-pushed the handle-404-validators branch from 8ca0186 to 3155e4d Compare May 1, 2022 16:10
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.

Handle 404 when updating status
3 participants