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

This commit is contained in:
Marc Cornellà 2022-02-23 18:44:31 +01:00
parent 914b6399e8
commit ff29836562

View file

@ -65,11 +65,11 @@ function is_update_available() {
local remote_head local remote_head
remote_head=$( remote_head=$(
if (( ${+commands[curl]} )); then if (( ${+commands[curl]} )); then
curl -fsSL -H 'Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null curl -m 2 -fsSL -H 'Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
elif (( ${+commands[wget]} )); then elif (( ${+commands[wget]} )); then
wget -O- --header='Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null wget -T 2 -O- --header='Accept: application/vnd.github.v3.sha' $api_url 2>/dev/null
elif (( ${+commands[fetch]} )); then elif (( ${+commands[fetch]} )); then
HTTP_ACCEPT='Accept: application/vnd.github.v3.sha' fetch -o - $api_url 2>/dev/null HTTP_ACCEPT='Accept: application/vnd.github.v3.sha' fetch -T 2 -o - $api_url 2>/dev/null
else else
exit 0 exit 0
fi fi