From f2a0d7d22e955083db8e391c5824747b29400b93 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Wed, 9 Jan 2013 16:23:15 +0100
Subject: [PATCH] taskdistribution: fix wrong calculation of watcher sleeps

There was a sign error in the formula and it lacks code to deal with clock
changes.
Because the watcher will be removed, this patch reverts to imprecise but safe
and simple implementation.
---
 erp5/util/taskdistribution/__init__.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/erp5/util/taskdistribution/__init__.py b/erp5/util/taskdistribution/__init__.py
index 0284104703..e40db1c45c 100644
--- a/erp5/util/taskdistribution/__init__.py
+++ b/erp5/util/taskdistribution/__init__.py
@@ -317,7 +317,6 @@ class TestResultProxy(RPCRetry):
     def _watcher(self):
         cond = self._watcher_condition
         while self._watcher_can_run and self.isAlive():
-            working = time.time()
             caption_list = []
             append = caption_list.append
             for name, (stream, max_history_bytes) in \
@@ -341,8 +340,7 @@ class TestResultProxy(RPCRetry):
                 append(caption)
             self.reportStatus('', '\n'.join(caption_list), '')
             with cond:
-                cond.wait(max(self._watcher_period - (working - time.time()),
-                    0))
+                cond.wait(self._watcher_period)
 
     def _stopWatching(self):
         cond = self._watcher_condition
-- 
2.30.9