added a small margin for the latency estimation

This commit is contained in:
study-faraphel 2025-02-03 19:21:06 +01:00
parent cad8221887
commit 1fbcf7b7c2

View file

@ -70,7 +70,7 @@ class MasterRole(base.BaseActiveRole):
)
)
# if there is not enough data, default to 5 seconds of latency
latency = timedelta(seconds=1) if len(latencies) <= 1 else numpy.max(latencies)
latency = timedelta(seconds=1) if len(latencies) <= 1 else (numpy.max(latencies) + timedelta(seconds=0.5))
# if the calculated latency is higher than the current one, update it
if latency > self.latency: