mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 07:09:23 +00:00
small improvements in long polling and behaviour buildr
This commit is contained in:
@@ -217,7 +217,7 @@ fun <T, BC : BehaviourContext> BC.launchInNewSubContext(
|
||||
updatesUpstreamFlow = updatesUpstreamFlow,
|
||||
subcontextInitialAction = subcontextInitialAction
|
||||
).apply {
|
||||
this@apply.launchLoggingDropExceptions(logger = Log ?: KSLog) {
|
||||
this@apply.launchLoggingDropExceptions(logger = Log) {
|
||||
behaviourContextReceiver()
|
||||
}
|
||||
}.coroutineContext.job
|
||||
|
@@ -40,7 +40,7 @@ class CombinedSubcontextInitialAction(
|
||||
runCatching {
|
||||
invoke(update)
|
||||
}.onFailure {
|
||||
(Log ?: logger).error(it) {
|
||||
Log.error(it) {
|
||||
"Unable to execute $subaction for update $update. Will try on next round"
|
||||
}
|
||||
}.onSuccess {
|
||||
@@ -50,7 +50,7 @@ class CombinedSubcontextInitialAction(
|
||||
}
|
||||
leftSubActions.removeAll(successSubActions)
|
||||
if (successSubActions.isEmpty()) {
|
||||
(Log ?: logger).error {
|
||||
Log.error {
|
||||
"Some SubActions have been unable to complete successfully:${leftSubActions.joinToString("\n") { it.toString() }}"
|
||||
}
|
||||
break
|
||||
|
Reference in New Issue
Block a user