Rename RemoveGoodFileTasks to RemoveSolvedFileTasks and add result argument

This commit is contained in:
shortcutme 2018-09-17 15:24:44 +02:00
parent 1eacc26ef9
commit 6c610c509f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 4 additions and 4 deletions

View file

@ -717,7 +717,7 @@ class UiWebsocketPlugin(object):
self.site.settings["autodownloadoptional"] = bool(owned)
self.site.bad_files = {}
gevent.spawn(self.site.update, check_files=True)
self.site.worker_manager.removeGoodFileTasks()
self.site.worker_manager.removeSolvedFileTasks()
def actionDbReload(self, to):
permissions = self.getPermissions(to)

View file

@ -120,12 +120,12 @@ class WorkerManager(object):
continue # No peers found yet for the optional task
return task
def removeGoodFileTasks(self):
def removeSolvedFileTasks(self, mark_as_good=True):
for task in self.tasks[:]:
if task["inner_path"] not in self.site.bad_files:
self.log.debug("No longer in bad_files, marking as good: %s" % task["inner_path"])
self.log.debug("No longer in bad_files, marking as %s: %s" % (mark_as_good, task["inner_path"]))
task["done"] = True
task["evt"].set(True)
task["evt"].set(mark_as_good)
self.tasks.remove(task)
if not self.tasks:
self.started_task_num = 0