Fix thread exit on blacklist

This commit is contained in:
2019-09-30 20:43:40 +01:00
parent 0430b713a9
commit bcb21295dd

View File

@@ -39,13 +39,14 @@ class Worker:
while not self.interrupt_flag['exit']: while not self.interrupt_flag['exit']:
job = self.queue.get() 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') logging.info('A worker thread exited')
break break
elif isinstance(job.box_item, Folder): if not (any(fnmatch(str(job.remote_path), x) for x in self.blacklist)):
self.do_folder(job) if isinstance(job.box_item, Folder):
else: self.do_folder(job)
self.do_file(job) else:
self.do_file(job)
self.queue.task_done() self.queue.task_done()
def do_folder(self, job: Job): def do_folder(self, job: Job):