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

This commit is contained in:
Adeeb Shihadeh
2024-12-20 15:28:52 -08:00
committed by GitHub
parent 7ac011ca89
commit 484b96f2b6
+1 -1
View File
@@ -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