From 1957133d9bd67bca4aeab6de927a751db8ec4126 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Tue, 23 Apr 2019 12:48:05 +0200 Subject: [PATCH] test and optimize adaptive polling --- README.md | 6 ++++-- bashbot.sh | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0ef3e69..81747c0 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Do * /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. - 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 ``` @@ -55,6 +56,7 @@ Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Do * Test your Bot with shellcheck * [Bashbot function reference](doc/6_reference.md) * [Notes for bashbot developers](doc/7_develop.md) +* [Customize bashbot environment](doc/8_customize.md) ## Note on Keyboards 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! -#### $$VERSION$$ v0.70-dev2-0-g4fff4c3 +#### $$VERSION$$ v0.70-dev2-5-gfe5840d diff --git a/bashbot.sh b/bashbot.sh index db3f090..0a1ecae 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -10,7 +10,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.70-dev2-4-g893ee61 +#### $$VERSION$$ v0.70-dev2-6-gc527d17 # # Exit Codes: # - 0 sucess (hopefully) @@ -609,8 +609,8 @@ process_message() { # main get updates loop, should never terminate start_bot() { local mysleep="100" # ms - local addsleep="50" - local maxsleep="${BASHBOT_SLEEP:-5000}" + local addsleep="100" + local maxsleep="$(( ${BASHBOT_SLEEP:-5000} + 100 ))" while true; do { UPDATE="$(curl -s "$UPD_URL$OFFSET" | ./${JSONSHFILE})"