mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-02 14:49:47 +00:00
Update BehaviourContextWithFSM.kt
This commit is contained in:
@@ -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