Skip to content

Commit 5f06620

Browse files
LitoMoresindresorhus
authored andcommitted
Exit the update check process if it does not respond after 30s (#156)
Fix #115
1 parent 79e89ad commit 5f06620

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

check.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const options = JSON.parse(process.argv[2]);
77
updateNotifier = new updateNotifier.UpdateNotifier(options);
88

99
(async () => {
10+
// Exit process when offline
11+
setTimeout(process.exit, 1000 * 30);
12+
1013
const update = await updateNotifier.checkNpm();
1114

1215
// Only update the last update check time on success

0 commit comments

Comments
 (0)