[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Reschedule failures immediately



commit 7ea42ac6815d46329d979cf6e93f750a440b4166
Author: aagbsn <aagbsn@xxxxxxxx>
Date:   Sun Aug 25 14:50:41 2013 +0200

    Reschedule failures immediately
    
    Reschedule failures immediately so they do not accrue at the end
    of the task list and eat memory.
---
 ooni/managers.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ooni/managers.py b/ooni/managers.py
index cc2d067..36b791e 100644
--- a/ooni/managers.py
+++ b/ooni/managers.py
@@ -37,8 +37,8 @@ class TaskManager(object):
 
         if task.failures <= self.retries:
             log.debug("Rescheduling...")
-            self._tasks = itertools.chain(self._tasks,
-                    makeIterable(task))
+            self._tasks = itertools.chain(makeIterable(task), self._tasks)
+
         else:
             # This fires the errback when the task is done but has failed.
             log.err('Permanent failure for %s' % task)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits