WorkerManager addTask returns task instead of event

This commit is contained in:
shortcutme 2017-10-03 15:47:46 +02:00
parent 468fe8f266
commit 9b8eeb6a73
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 4 additions and 4 deletions

View file

@ -737,7 +737,7 @@ class Site(object):
gevent.spawn(self.announce)
if inner_path != "content.json": # Prevent double download
task = self.worker_manager.addTask("content.json", peer)
task.get()
task["evt"].get()
self.content_manager.loadContent()
if not self.content_manager.contents.get("content.json"):
return False # Content.json download failed
@ -762,7 +762,7 @@ class Site(object):
task = self.worker_manager.addTask(inner_path, peer, priority=priority)
if blocking:
return task.get()
return task["evt"].get()
else:
return task

View file

@ -424,7 +424,7 @@ class WorkerManager(object):
if priority:
task["priority"] += priority # Boost on priority
return task["evt"]
return task
else: # No task for that file yet
evt = gevent.event.AsyncResult()
if peer:
@ -470,7 +470,7 @@ class WorkerManager(object):
else:
self.startWorkers(peers)
return evt
return task
# Find a task using inner_path
def findTask(self, inner_path):