From b3b20b2b28f245dedd7344d9eaa484efb362f9e9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 25 Sep 2024 11:44:24 +0100 Subject: [PATCH] rclone backend: fix hang on termination Before this change the rclone backend was creating a non daemon thread which was hanging borgstore when it quit without closing the backend. This patch changes the thread into a daemon thread which won't stop the program from exiting when the thread is running. Fixes #54 --- src/borgstore/backends/rclone.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borgstore/backends/rclone.py b/src/borgstore/backends/rclone.py index 9ce5663..8df41cf 100644 --- a/src/borgstore/backends/rclone.py +++ b/src/borgstore/backends/rclone.py @@ -112,7 +112,7 @@ def discard(): if not line: break # Process has finished - thread = threading.Thread(target=discard) + thread = threading.Thread(target=discard, daemon=True) thread.start() def close(self):