Skip to content

Commit

Permalink
make sure we stop all channels when context transitions to Disabled (#90
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ekoby authored Nov 10, 2020
1 parent 4eed4f8 commit 1402547
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ziti/src/main/kotlin/org/openziti/impl/ZitiContextImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ internal class ZitiContextImpl(internal val id: Identity, enabled: Boolean) : Zi
this._enabled = enabled

launch {
statusCh.takeWhile {it != ZitiContext.Status.Disabled}.collect {
statusCh.collect {
d { "${this@ZitiContextImpl} transitioned to $it" }
if (it == ZitiContext.Status.Disabled) {
stop()
}
}
stop()
}

runServiceUpdates(login())
Expand Down

0 comments on commit 1402547

Please sign in to comment.