Browse Source

Fixes "Substantial drift" warning if measurement is too fast for floating point

Ask Solem 11 years ago
parent
commit
4be0d2e0ad
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/events/state.py

+ 1 - 1
celery/events/state.py

@@ -147,7 +147,7 @@ class Worker(AttributeDict):
     def update_heartbeat(self, received, timestamp):
         if not received or not timestamp:
             return
-        drift = abs(received - timestamp)
+        drift = int(received) - int(timestamp)
         if drift > HEARTBEAT_DRIFT_MAX:
             warn(DRIFT_WARNING, self.hostname, drift)
         heartbeats, hbmax = self.heartbeats, self.heartbeat_max