test and optimize adaptive polling

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-04-23 12:48:05 +02:00
parent c527d175f0
commit 1957133d9b
2 changed files with 7 additions and 5 deletions

View File

@ -22,7 +22,8 @@ Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Do
* /usr/local if you want to run as service * /usr/local if you want to run as service
2. [Download latest release zip from github](https://github.com/topkecleon/telegram-bot-bash/releases) and extract all files. 2. [Download latest release zip from github](https://github.com/topkecleon/telegram-bot-bash/releases) and extract all files.
As an alternative you can clone the github repository to get the latest improvements, run All-tests.sh to be shure. As an alternative you can clone the github repository to get the latest improvements/fixes,
run bashbot test suite ``All-tests.sh`` afterwards to see if code looks OK.
``` ```
git clone https://github.com/topkecleon/telegram-bot-bash; test/ALL-tests.sh git clone https://github.com/topkecleon/telegram-bot-bash; test/ALL-tests.sh
``` ```
@ -55,6 +56,7 @@ Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Do
* Test your Bot with shellcheck * Test your Bot with shellcheck
* [Bashbot function reference](doc/6_reference.md) * [Bashbot function reference](doc/6_reference.md)
* [Notes for bashbot developers](doc/7_develop.md) * [Notes for bashbot developers](doc/7_develop.md)
* [Customize bashbot environment](doc/8_customize.md)
## Note on Keyboards ## Note on Keyboards
From Version 0.60 on keybord format for ```send_keyboard``` and ```send_message "mykeyboardstartshere ..."``` was changed. From Version 0.60 on keybord format for ```send_keyboard``` and ```send_message "mykeyboardstartshere ..."``` was changed.
@ -102,4 +104,4 @@ Bashbot is not more (in)secure as any other Bot written in any other language, w
If you feel that there's something missing or if you found a bug, feel free to submit a pull request! If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
#### $$VERSION$$ v0.70-dev2-0-g4fff4c3 #### $$VERSION$$ v0.70-dev2-5-gfe5840d

View File

@ -10,7 +10,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.70-dev2-4-g893ee61 #### $$VERSION$$ v0.70-dev2-6-gc527d17
# #
# Exit Codes: # Exit Codes:
# - 0 sucess (hopefully) # - 0 sucess (hopefully)
@ -609,8 +609,8 @@ process_message() {
# main get updates loop, should never terminate # main get updates loop, should never terminate
start_bot() { start_bot() {
local mysleep="100" # ms local mysleep="100" # ms
local addsleep="50" local addsleep="100"
local maxsleep="${BASHBOT_SLEEP:-5000}" local maxsleep="$(( ${BASHBOT_SLEEP:-5000} + 100 ))"
while true; do { while true; do {
UPDATE="$(curl -s "$UPD_URL$OFFSET" | ./${JSONSHFILE})" UPDATE="$(curl -s "$UPD_URL$OFFSET" | ./${JSONSHFILE})"