small optimization of updates polling exception handling

This commit is contained in:
InsanusMokrassar committed 2020-04-13 12:53:02 +06:00
1 parent 8c76283db5
commit 88eebdc448
1 file changed
+3 -7
@@ -27,13 +27,9 @@ fun RequestsExecutor.startGettingOfUpdates(
while (isActive) {
handleSafely(
{ e ->
when (e) {
is HttpRequestTimeoutException -> exceptionsHandler ?.invoke(e)
is RequestException -> {
exceptionsHandler ?.invoke(e)
delay(1000L)
}
else -> exceptionsHandler ?.invoke(e)
exceptionsHandler ?.invoke(e)
if (e is RequestException) {
delay(1000L)
}
}
) {