mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
small optimization of updates polling exception handling
This commit is contained in:
parent
8c76283db5
commit
88eebdc448
@ -27,14 +27,10 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
while (isActive) {
|
while (isActive) {
|
||||||
handleSafely(
|
handleSafely(
|
||||||
{ e ->
|
{ e ->
|
||||||
when (e) {
|
|
||||||
is HttpRequestTimeoutException -> exceptionsHandler ?.invoke(e)
|
|
||||||
is RequestException -> {
|
|
||||||
exceptionsHandler ?.invoke(e)
|
exceptionsHandler ?.invoke(e)
|
||||||
|
if (e is RequestException) {
|
||||||
delay(1000L)
|
delay(1000L)
|
||||||
}
|
}
|
||||||
else -> exceptionsHandler ?.invoke(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
val updates = getUpdates(
|
val updates = getUpdates(
|
||||||
|
Loading…
Reference in New Issue
Block a user