From b492aaab50d9d2f7cabafd1ad763b9114ac502c6 Mon Sep 17 00:00:00 2001 From: Udi Schwager Date: Fri, 16 Apr 2021 16:29:19 -0400 Subject: [PATCH] Fix the issue that a Freerun event might be posted at the end of holdover timer The code now rounds the time that the PHC is in holdover Before it was waiting an additional time to produce the event because of the precision digits Partial-Bug: 1924201 Signed-off-by: Udi Schwager Change-Id: I77ecfe6c7eebf2a40cab5376878adefadb32d526 --- .../trackingfunctionsdk/common/helpers/ptpsync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notificationservice-base/centos/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py b/notificationservice-base/centos/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py index 51308ed..024457a 100644 --- a/notificationservice-base/centos/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py +++ b/notificationservice-base/centos/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py @@ -136,7 +136,7 @@ def ptp_status(holdover_time, freq, sync_state, event_time): # Freerun —> Locked # #################################### current_time = datetime.datetime.now().timestamp() - time_in_holdover = current_time - event_time + time_in_holdover = round(current_time - event_time) previous_sync_state = sync_state # max holdover time is calculated to be in a 'safety' zoon max_holdover_time = (holdover_time - freq * 2)