1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-10-25 09:10:07 +00:00

Update BehaviourContextWithFSM.kt

This commit is contained in:
2022-12-29 08:12:02 +06:00
committed by GitHub
parent c193b512d9
commit 887c51f83a

View File

@@ -173,12 +173,14 @@ class DefaultBehaviourContextWithFSM<T : State>(
fun Job.enableRemoveOnCompletion(state: T) {
invokeOnCompletion {
launchSafelyWithoutExceptions {
statesJobsMutex.withLock {
if (this@enableRemoveOnCompletion === statesJobs[state]) {
statesJobs.remove(state)
}
}
}
}
}
statesManager.onStartChain.subscribeSafelyWithoutExceptions(this) {
statesJobsMutex.withLock {