Skip to content

Commit

Permalink
Exit the update check process if it does not respond after 30s (#156)
Browse files Browse the repository at this point in the history
Fix #115
  • Loading branch information
LitoMore authored and sindresorhus committed Apr 19, 2019
1 parent 79e89ad commit 5f06620
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions check.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const options = JSON.parse(process.argv[2]);
updateNotifier = new updateNotifier.UpdateNotifier(options);

(async () => {
// Exit process when offline
setTimeout(process.exit, 1000 * 30);

const update = await updateNotifier.checkNpm();

// Only update the last update check time on success
Expand Down

0 comments on commit 5f06620

Please sign in to comment.