Rename RemoveGoodFileTasks to RemoveSolvedFileTasks and add result argument
This commit is contained in:
parent
1eacc26ef9
commit
6c610c509f
2 changed files with 4 additions and 4 deletions
|
@ -717,7 +717,7 @@ class UiWebsocketPlugin(object):
|
||||||
self.site.settings["autodownloadoptional"] = bool(owned)
|
self.site.settings["autodownloadoptional"] = bool(owned)
|
||||||
self.site.bad_files = {}
|
self.site.bad_files = {}
|
||||||
gevent.spawn(self.site.update, check_files=True)
|
gevent.spawn(self.site.update, check_files=True)
|
||||||
self.site.worker_manager.removeGoodFileTasks()
|
self.site.worker_manager.removeSolvedFileTasks()
|
||||||
|
|
||||||
def actionDbReload(self, to):
|
def actionDbReload(self, to):
|
||||||
permissions = self.getPermissions(to)
|
permissions = self.getPermissions(to)
|
||||||
|
|
|
@ -120,12 +120,12 @@ class WorkerManager(object):
|
||||||
continue # No peers found yet for the optional task
|
continue # No peers found yet for the optional task
|
||||||
return task
|
return task
|
||||||
|
|
||||||
def removeGoodFileTasks(self):
|
def removeSolvedFileTasks(self, mark_as_good=True):
|
||||||
for task in self.tasks[:]:
|
for task in self.tasks[:]:
|
||||||
if task["inner_path"] not in self.site.bad_files:
|
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["done"] = True
|
||||||
task["evt"].set(True)
|
task["evt"].set(mark_as_good)
|
||||||
self.tasks.remove(task)
|
self.tasks.remove(task)
|
||||||
if not self.tasks:
|
if not self.tasks:
|
||||||
self.started_task_num = 0
|
self.started_task_num = 0
|
||||||
|
|
Loading…
Reference in a new issue