File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1212import logging
1313import signal
1414import sys
15+ import threading
1516
1617from aiida .common .log import configure_logging
1718from aiida .engine .daemon .client import get_daemon_client
@@ -98,9 +99,13 @@ def start_daemon_worker(foreground: bool = False) -> None:
9899 # https://github.com/python/mypy/issues/12557
99100 runner .loop .add_signal_handler (s , lambda s = s : asyncio .create_task (shutdown_worker (runner ))) # type: ignore[misc]
100101
102+ # XXX: check the threading use is elegantly implemented: e.g. log handle, error handle, shutdown handle.
103+ LOGGER .info ('Starting a daemon worker' )
104+ runner_thread = threading .Thread (target = runner .start , daemon = True )
105+ runner_thread .start ()
106+
101107 try :
102- LOGGER .info ('Starting a daemon worker' )
103- runner .start ()
108+ runner_thread .join ()
104109 except SystemError as exception :
105110 LOGGER .info ('Received a SystemError: %s' , exception )
106111 runner .close ()
You can’t perform that action at this time.
0 commit comments