Explorar o código

and include abs with that for negative values...

Ask Solem %!s(int64=11) %!d(string=hai) anos
pai
achega
8dc0b9f54b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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