summaryrefslogtreecommitdiff
path: root/subplot/vendored/daemon.py
diff options
context:
space:
mode:
Diffstat (limited to 'subplot/vendored/daemon.py')
-rw-r--r--subplot/vendored/daemon.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/subplot/vendored/daemon.py b/subplot/vendored/daemon.py
index d436b4f..11f65bf 100644
--- a/subplot/vendored/daemon.py
+++ b/subplot/vendored/daemon.py
@@ -140,13 +140,17 @@ def daemon_wait_for_port(host, port, timeout=5.0):
s.close()
return
except socket.timeout:
- logging.error(f"daemon did not respond at port {port} within {timeout} seconds")
+ logging.error(
+ f"daemon did not respond at port {port} within {timeout} seconds"
+ )
raise
except socket.error as e:
logging.info(f"could not connect to daemon at {port}: {e}")
pass
if time.time() >= until:
- logging.error(f"could not connect to daemon at {port} within {timeout} seconds")
+ logging.error(
+ f"could not connect to daemon at {port} within {timeout} seconds"
+ )
raise ConnectionRefusedError()
# Sleep a bit to avoid consuming too much CPU while busy-waiting.
time.sleep(0.1)
@@ -198,7 +202,9 @@ def daemon_process_exists(ctx, args=None):
def _daemon_pgrep(pattern):
logging.info(f"checking if process exists: pattern={pattern}")
- exit = subprocess.call(["pgrep", "-laf", pattern], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ exit = subprocess.call(
+ ["pgrep", "-laf", pattern], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
+ )
logging.info(f"exit code: {exit}")
return exit == 0