Restart find optional files algorithm if new task started since running the function

This commit is contained in:
shortcutme 2017-10-03 15:52:04 +02:00
parent 988d169687
commit e85efe2c64
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 4 additions and 0 deletions

View File

@ -356,6 +356,10 @@ class WorkerManager(object):
if len(found) < len(optional_hash_ids):
self.log.debug("No findhash result for optional files: %s" % (optional_hash_ids - set(found)))
if time_tasks != self.time_task_added: # New task added since start
self.log.debug("New task since start, restarting...")
gevent.spawn_later(0.1, self.startFindOptional)
# Stop all worker
def stopWorkers(self):
for worker in self.workers.values():