From a7bdf6e05cd924de73a75f2186577915d9a31616 Mon Sep 17 00:00:00 2001 From: Danilo Horta Date: Fri, 6 Dec 2024 11:57:45 +0000 Subject: [PATCH] =?UTF-8?q?Add=20readiness=20check=20in=20daemon=20context?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Modified `daemon.py` to include `wait_for_readiness()` function. - Ensures the daemon is fully operational after spawning. This change enhances the reliability of the daemon by confirming it's ready before proceeding. This minimizes potential errors due to asynchronous operation states. 📈 --- h3daemon/h3daemon/daemon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/h3daemon/h3daemon/daemon.py b/h3daemon/h3daemon/daemon.py index 0d8024f..7e02508 100644 --- a/h3daemon/h3daemon/daemon.py +++ b/h3daemon/h3daemon/daemon.py @@ -147,6 +147,7 @@ def daemon_context(hmmfile: HMMFile, cport: int = 0, wport: int = 0): ensure_pressed(hmmfile) x = Daemon.spawn(hmmfile, cport, wport) try: + x.wait_for_readiness() yield x finally: x.shutdown()