modules: processUpdates: show sleep minutes
This commit is contained in:
parent
4e7b3052de
commit
e4a983b16f
|
@ -1,2 +1,2 @@
|
||||||
{"update_id":665220889,
|
{"update_id":665220889,
|
||||||
"message":{"message_id":760,"from":{"id":586928566,"is_bot":false,"first_name":"Kay","last_name":"M","username":"KayM_Dealz","language_code":"de"},"chat":{"id":586928566,"first_name":"Kay","last_name":"M","username":"KayM_Dealz","type":"private"},"date":1612029749,"text":"/info","entities":[{"offset":0,"length":5,"type":"bot_command"}]}}
|
"message":{"message_id":760,"from":{"id":586928566,"is_bot":false,"first_name":"Kay","last_name":"M","username":"KayM","language_code":"de"},"chat":{"id":589682731,"first_name":"Kay","last_name":"M","username":"KayM","type":"private"},"date":1612029749,"text":"/info","entities":[{"offset":0,"length":5,"type":"bot_command"}]}}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# File: processUpdates.sh
|
# File: processUpdates.sh
|
||||||
# Note: DO NOT EDIT! this file will be overwritten on update
|
# Note: DO NOT EDIT! this file will be overwritten on update
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.40-dev-19-g0dd5f83
|
#### $$VERSION$$ v1.40-dev-23-g4e7b305
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
##############
|
##############
|
||||||
|
@ -342,7 +342,7 @@ get_updates(){
|
||||||
# did we get an response?
|
# did we get an response?
|
||||||
if [ -n "${UPDATE}" ]; then
|
if [ -n "${UPDATE}" ]; then
|
||||||
# we got something, do processing
|
# we got something, do processing
|
||||||
[ "${OFFSET}" = "-999" ] && [ "${nextsleep}" -gt "$((maxsleep/2))" ] &&\
|
[ "${OFFSET}" = "-999" ] && [ "${nextsleep}" -gt "$((maxsleep*2))" ] &&\
|
||||||
log_error "Recovered from timeout/broken/no connection, continue with telegram updates"
|
log_error "Recovered from timeout/broken/no connection, continue with telegram updates"
|
||||||
# calculate next sleep interval
|
# calculate next sleep interval
|
||||||
((nextsleep+= stepsleep , nextsleep= nextsleep>maxsleep ?maxsleep:nextsleep))
|
((nextsleep+= stepsleep , nextsleep= nextsleep>maxsleep ?maxsleep:nextsleep))
|
||||||
|
@ -351,8 +351,8 @@ get_updates(){
|
||||||
# warn if webhook is set
|
# warn if webhook is set
|
||||||
if grep -q '^\["error_code"\] 409' <<<"${UPDATE}"; then
|
if grep -q '^\["error_code"\] 409' <<<"${UPDATE}"; then
|
||||||
[ "${OFFSET}" != "-999" ] && nextsleep="${stepsleep}"
|
[ "${OFFSET}" != "-999" ] && nextsleep="${stepsleep}"
|
||||||
OFFSET="-999"; errsleep="$(_round_float "$(( errsleep = 200 * nextsleep ))e-3" "1")"
|
OFFSET="-999"; errsleep="$(_round_float "$(( errsleep= 300*nextsleep ))e-3")"
|
||||||
log_error "Warning conflicting webhook set, can't get updates until delete_webhook! Sleep ${errsleep}s ..."
|
log_error "Warning conflicting webhook set, can't get updates until delete_webhook! Sleep $((errsleep/60)) min ..."
|
||||||
sleep "${errsleep}"
|
sleep "${errsleep}"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue