From f6279b356ad4d1ebdad82e851438d9e09e051a7c Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 27 Jul 2021 22:11:33 +0200 Subject: [PATCH] fix more signal handler jank --- copyparty/authsrv.py | 2 +- copyparty/svchub.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index ecb8cb89..7268f222 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -709,7 +709,7 @@ class AuthSrv(object): u = list(sorted(getattr(v.axs, attr).keys())) u = ", ".join("\033[35meverybody\033[0m" if x == "*" else x for x in u) u = u if u else "\033[36m--none--\033[0m" - m += "\n {}: {}".format(txt, u) + m += "\n| {}: {}".format(txt, u) m += "\n" if self.warn_anonwrite and not self.args.no_voldump: diff --git a/copyparty/svchub.py b/copyparty/svchub.py index 17d873eb..0cdb1fb2 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -96,7 +96,6 @@ class SvcHub(object): m = "{}/{} workers failed to start" m = m.format(failed, self.broker.num_workers) self.log("root", m, 1) - #self.signal_handler(1,1) os._exit(1) def cb_httpsrv_up(self): @@ -166,8 +165,8 @@ class SvcHub(object): for sig in [signal.SIGINT, signal.SIGTERM]: signal.signal(sig, self.signal_handler) - # windows cannot ^c stop_cond, # macos hangs after shutdown on sigterm with while-sleep, + # windows cannot ^c stop_cond (and win10 does the macos thing but winxp is fine??) # linux is fine with both, # never lucky if ANYWIN: @@ -176,10 +175,9 @@ class SvcHub(object): thr.daemon = True thr.start() - ival = 1 if sys.gettrace() else 9001 try: while not self.stop_req: - time.sleep(ival) + time.sleep(1) except: pass