mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-21 03:03:17 +00:00
Update BehaviourContextWithFSM.kt
This commit is contained in:
1 parent
c193b512d9
commit
887c51f83a
1 file changed
+4
-2
+4
-2
@@ -173,8 +173,10 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
||||
fun Job.enableRemoveOnCompletion(state: T) {
|
||||
invokeOnCompletion {
|
||||
launchSafelyWithoutExceptions {
|
||||
if (this@enableRemoveOnCompletion === statesJobs[state]) {
|
||||
statesJobs.remove(state)
|
||||
statesJobsMutex.withLock {
|
||||
if (this@enableRemoveOnCompletion === statesJobs[state]) {
|
||||
statesJobs.remove(state)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user