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

ADD timeout to update check #4530

Merged
merged 2 commits into from
Oct 23, 2018
Merged

ADD timeout to update check #4530

merged 2 commits into from
Oct 23, 2018

Conversation

ndelangen
Copy link
Member

This way if for some reason the update check 'hangs', we ignore it and continue without it.

@ndelangen ndelangen added maintenance User-facing maintenance tasks cli labels Oct 23, 2018
@ndelangen ndelangen added this to the v4.0.0 milestone Oct 23, 2018
@ndelangen ndelangen self-assigned this Oct 23, 2018
@ndelangen ndelangen requested a review from shilman October 23, 2018 13:45
@codecov
Copy link

codecov bot commented Oct 23, 2018

Codecov Report

Merging #4530 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4530      +/-   ##
==========================================
- Coverage    35.7%   35.69%   -0.01%     
==========================================
  Files         557      557              
  Lines        6708     6709       +1     
  Branches      879      879              
==========================================
  Hits         2395     2395              
- Misses       3858     3859       +1     
  Partials      455      455
Impacted Files Coverage Δ
lib/core/src/server/build-dev.js 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e446f08...c7bf9f2. Read the comment docs.

fetch(`https://storybook.js.org/versions.json?current=${version}`),
// if fetch is too slow, we won't wait for it
new Promise((res, rej) => global.setTimeout(rej, 1500)),
]);
Copy link
Member

Choose a reason for hiding this comment

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

Won't the const data = await fromFetch.json(); fail in case of a timeout?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ndelangen ndelangen merged commit 76616c1 into master Oct 23, 2018
@ndelangen ndelangen deleted the tech/smarter-update-check branch October 23, 2018 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants