mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 03:52:11 +08:00
timed: diff against absolute value of timedelta (#34299)
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user