Attach is in executor, use call_soon_threadsafe (#3771)

* Attach is in executor, use `call_soon_threadsafe`

* Fix formatting
This commit is contained in:
Mike Degatano 2022-08-04 12:33:54 -04:00 committed by GitHub
parent f87209f66f
commit 27ac96f5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -352,7 +352,8 @@ class DockerInterface(CoreSysAttributes):
and state in [ContainerState.STOPPED, ContainerState.FAILED] and state in [ContainerState.STOPPED, ContainerState.FAILED]
): ):
# Fire event with current state of container # Fire event with current state of container
self.sys_bus.fire_event( self.sys_loop.call_soon_threadsafe(
self.sys_bus.fire_event,
BusEvent.DOCKER_CONTAINER_STATE_CHANGE, BusEvent.DOCKER_CONTAINER_STATE_CHANGE,
DockerContainerStateEvent( DockerContainerStateEvent(
self.name, state, docker_container.id, int(time()) self.name, state, docker_container.id, int(time())