ff298365626c4366eac930793918c6fbfb8c5d9a

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix(updater): timeout after 2s on available update check

Diff

 1diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
 2index a36aecb841a4ed8de2e9a71aaee78409690d38dc..2ad1fca9288b43d2b0043b97cb435d7b94a68260 100644
 3--- a/tools/check_for_upgrade.sh
 4+++ b/tools/check_for_upgrade.sh
 5@@ -65,11 +65,11 @@ function is_update_available() {
 6   local remote_head
 7   remote_head=$(
 8     if (( ${+commands[curl]} )); then
 9-      curl -fsSL -H 'Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
10+      curl -m 2 -fsSL -H 'Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
11     elif (( ${+commands[wget]} )); then
12-      wget -O- --header='Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
13+      wget -T 2 -O- --header='Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
14     elif (( ${+commands[fetch]} )); then
15-      HTTP_ACCEPT='Accept: application/vnd.github.v3.sha' fetch -o - $api_url 2>/dev/null
16+      HTTP_ACCEPT='Accept: application/vnd.github.v3.sha' fetch -T 2 -o - $api_url 2>/dev/null
17     else
18       exit 0
19     fi