mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-01 17:33:01 +00:00
fix in updates unique calculation and update dependencies
This commit is contained in:
1 parent
3b2310ece1
commit
241545c0cb
3 files changed
+10
-6
No files matched your search
+6
-3
@@ -76,9 +76,12 @@ class DefaultBehaviourContext(
|
||||
(it + upstreamUpdatesFlow).filter {
|
||||
val passed = handledUpdates.add(it.updateId)
|
||||
(passed).also { passed ->
|
||||
handledUpdates.removeAll(
|
||||
handledUpdates.take(handledUpdates.size - broadcastChannelsSize).ifEmpty { return@also }
|
||||
)
|
||||
val needToDropCount = handledUpdates.size - broadcastChannelsSize
|
||||
if (needToDropCount > 0) {
|
||||
handledUpdates.removeAll(
|
||||
handledUpdates.take(needToDropCount).ifEmpty { return@also }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user