Преглед изворни кода

and include abs with that for negative values...

Ask Solem пре 11 година
родитељ
комит
8dc0b9f54b
1 измењених фајлова са 1 додато и 1 уклоњено
  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 = int(received) - int(timestamp)
+        drift = abs(int(received) - int(timestamp))
         if drift > HEARTBEAT_DRIFT_MAX:
             warn(DRIFT_WARNING, self.hostname, drift)
         heartbeats, hbmax = self.heartbeats, self.heartbeat_max