From 2c92dab165f3eedd7a56434f15277ba1e0c5f50d Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 9 May 2024 14:17:53 +0000 Subject: [PATCH] fix small annoyances, * mute exception on early shutdown * sfx: give the utime thread a name --- copyparty/up2k.py | 8 +++++++- scripts/sfx.py | 2 +- scripts/ziploader.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index bfb40530..f1ec0009 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -461,7 +461,13 @@ class Up2k(object): # important; not deferred by db_act timeout = self._check_lifetimes() - timeout = min(timeout, now + self._check_xiu()) + try: + timeout = min(timeout, now + self._check_xiu()) + except Exception as ex: + if "closed cursor" in str(ex): + self.log("sched_rescan: lost db") + return + raise with self.mutex: for vp, vol in sorted(self.asrv.vfs.all_vols.items()): diff --git a/scripts/sfx.py b/scripts/sfx.py index 7af2f905..0203571c 100644 --- a/scripts/sfx.py +++ b/scripts/sfx.py @@ -398,7 +398,7 @@ def run(tmp, j2, ftp): msg("sfxdir:", tmp) msg() - t = threading.Thread(target=utime, args=(tmp,)) + t = threading.Thread(target=utime, args=(tmp,), name="utime") t.daemon = True t.start() diff --git a/scripts/ziploader.py b/scripts/ziploader.py index d06b7baa..bbf4152e 100644 --- a/scripts/ziploader.py +++ b/scripts/ziploader.py @@ -80,7 +80,7 @@ def run(): msg(" rsrc dir:", rsrc) msg() - t = threading.Thread(target=utime, args=(rsrc,)) + t = threading.Thread(target=utime, args=(rsrc,), name="utime") t.daemon = True t.start()