timed: diff against absolute value of timedelta (#34299)

pull/34254/head
Adeeb Shihadeh 4 months ago committed by GitHub
parent 7ac011ca89
commit 484b96f2b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      system/timed.py

@ -13,7 +13,7 @@ from openpilot.common.gps import get_gps_location_service
def set_time(new_time):
diff = datetime.datetime.now() - new_time
if diff < datetime.timedelta(seconds=10):
if abs(diff) < datetime.timedelta(seconds=10):
cloudlog.debug(f"Time diff too small: {diff}")
return

Loading…
Cancel
Save