commit 069582c7d14f74851985acec06d999cd2a3b0452 Author: Arturo Filastò art@fuffa.org Date: Thu Feb 28 20:46:14 2013 +0100
Add more debugging to managers --- ooni/managers.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/ooni/managers.py b/ooni/managers.py index 011e3b0..17b430d 100644 --- a/ooni/managers.py +++ b/ooni/managers.py @@ -1,5 +1,6 @@ import itertools from twisted.internet import defer +from ooni.utils import log
def makeIterable(item): """ @@ -28,6 +29,9 @@ class TaskManager(object): The has failed to complete, we append it to the end of the task chain to be re-run once all the currently scheduled tasks have run. """ + log.err("Task %s has failed" % task) + log.exception(failure) + self._active_tasks.remove(task) self.failures.append((failure, task))
@@ -93,6 +97,8 @@ class TaskManager(object): Takes as argument a single task or a task iterable and appends it to the task generator queue. """ + log.debug("Starting this task %s" % repr(task_or_task_iterator)) + iterable = makeIterable(task_or_task_iterator)
self._tasks = itertools.chain(self._tasks, iterable) @@ -138,7 +144,8 @@ class MeasurementManager(TaskManager): concurrency = 10
def succeeded(self, result, measurement): - pass + log.debug("Successfully performed measurement %s" % measurement) + log.debug(result)
def failed(self, failure, measurement): pass @@ -149,7 +156,8 @@ class ReportEntryManager(TaskManager): concurrency = 20
def succeeded(self, result, task): - pass + log.debug("Successfully performed report %s" % task) + log.debug(result)
def failed(self, failure, task): pass
tor-commits@lists.torproject.org