1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

small optimization of updates polling exception handling

This commit is contained in:
InsanusMokrassar 2020-04-13 12:53:02 +06:00
parent 8c76283db5
commit 88eebdc448

View File

@ -27,13 +27,9 @@ fun RequestsExecutor.startGettingOfUpdates(
while (isActive) { while (isActive) {
handleSafely( handleSafely(
{ e -> { e ->
when (e) { exceptionsHandler ?.invoke(e)
is HttpRequestTimeoutException -> exceptionsHandler ?.invoke(e) if (e is RequestException) {
is RequestException -> { delay(1000L)
exceptionsHandler ?.invoke(e)
delay(1000L)
}
else -> exceptionsHandler ?.invoke(e)
} }
} }
) { ) {