fix github rate limit wait
This commit is contained in:
parent
0fd770c8fe
commit
18bde96638
|
@ -81,9 +81,10 @@ plugin=$(apiCall "GET" "system/plugins" | jq '.[]|select(.name=="Deemix")')
|
||||||
if [ -z "$plugin" ] || [ "$(echo "$plugin" | jq .updateAvailable)" = "true" ]; then
|
if [ -z "$plugin" ] || [ "$(echo "$plugin" | jq .updateAvailable)" = "true" ]; then
|
||||||
echo "[autoconfig] Installing / Updating Deemix plugin"
|
echo "[autoconfig] Installing / Updating Deemix plugin"
|
||||||
githubRate=$(curl -s https://api.github.com/rate_limit | jq .rate)
|
githubRate=$(curl -s https://api.github.com/rate_limit | jq .rate)
|
||||||
if [ "$(echo "$githubRate" | jq .remaining)" = "60" ]; then
|
if [ "$(echo "$githubRate" | jq .remaining)" = "0" ]; then
|
||||||
echo "[autoconfig] Waiting github rate limit reset"
|
deltaGithubResetTime=$(( $(echo "$githubRate" | jq .reset) - $(date +%s) + 5 ))
|
||||||
sleep $(( $(echo "$githubRate" | jq .reset) - $(date +%s) + 5 ))
|
echo "[autoconfig] Waiting github rate limit reset : $deltaGithubResetTime seconds"
|
||||||
|
sleep $deltaGithubResetTime
|
||||||
fi
|
fi
|
||||||
apiCall "POST" "command" '{"name":"InstallPlugin","githubUrl":"'$urlPlugin'"}'
|
apiCall "POST" "command" '{"name":"InstallPlugin","githubUrl":"'$urlPlugin'"}'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue