From 5f06620ff31336be8d865df5741129b6694e1cd7 Mon Sep 17 00:00:00 2001 From: LitoMore Date: Fri, 19 Apr 2019 17:59:33 +0800 Subject: [PATCH] Exit the update check process if it does not respond after 30s (#156) Fix #115 --- check.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check.js b/check.js index 1d0eee8..11dba33 100644 --- a/check.js +++ b/check.js @@ -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