mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-27 11:29:34 +00:00
Merge branch 'break-in-loop' into next
This commit is contained in:
commit
4c388903cb
1 changed files with 11 additions and 12 deletions
|
|
@ -68,18 +68,17 @@
|
|||
|
||||
:local Data false;
|
||||
:for I from=1 to=4 do={
|
||||
:if ($Data = false) do={
|
||||
:onerror Err {
|
||||
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
||||
("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \
|
||||
$TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data");
|
||||
:set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ];
|
||||
} do={
|
||||
:if ($I < 4) do={
|
||||
$LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err);
|
||||
:set TelegramRandomDelay [ $MIN 15 ($TelegramRandomDelay + 5) ];
|
||||
:delay (($I * $I) . "s");
|
||||
}
|
||||
:onerror Err {
|
||||
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
||||
("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \
|
||||
$TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data");
|
||||
:set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ];
|
||||
:break;
|
||||
} do={
|
||||
:if ($I < 4) do={
|
||||
$LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err);
|
||||
:set TelegramRandomDelay [ $MIN 15 ($TelegramRandomDelay + 5) ];
|
||||
:delay (($I * $I) . "s");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue