From bcb21295dd2776195e16f472a61f3eb79f0e584d Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 30 Sep 2019 20:43:40 +0100 Subject: [PATCH] Fix thread exit on blacklist --- src/worker.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/worker.py b/src/worker.py index 7fe13ef..87cd341 100644 --- a/src/worker.py +++ b/src/worker.py @@ -39,13 +39,14 @@ class Worker: while not self.interrupt_flag['exit']: job = self.queue.get() - if (job is None) or (any(fnmatch(str(job.remote_path), x) for x in self.blacklist)): + if job is None: logging.info('A worker thread exited') break - elif isinstance(job.box_item, Folder): - self.do_folder(job) - else: - self.do_file(job) + if not (any(fnmatch(str(job.remote_path), x) for x in self.blacklist)): + if isinstance(job.box_item, Folder): + self.do_folder(job) + else: + self.do_file(job) self.queue.task_done() def do_folder(self, job: Job):