From fe954babc702177b8572e11d4287de1e597dc6a1 Mon Sep 17 00:00:00 2001 From: clore Date: Sat, 7 Dec 2024 02:05:17 +0000 Subject: [PATCH] some delay for latency measurment from start --- clore_hosting/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clore_hosting/main.py b/clore_hosting/main.py index fef7e78..f9031c5 100644 --- a/clore_hosting/main.py +++ b/clore_hosting/main.py @@ -146,6 +146,7 @@ class CloreClient: self.clore_partner_initiazized = False self.partner_forwarding_ips = [] + self.start_time = utils.unix_timestamp() async def service(self): global container_log_broken @@ -597,9 +598,10 @@ class CloreClient: while True: try: await monitoring.put("partner_service") - forwarding_latency_measurment = await clore_partner.measure_forwarding_latency() - if type(forwarding_latency_measurment) == list: - await WebSocketClient.set_forwarding_latency_measurment(forwarding_latency_measurment) + if self.start_time < utils.unix_timestamp() - 180: + forwarding_latency_measurment = await clore_partner.measure_forwarding_latency() + if type(forwarding_latency_measurment) == list: + await WebSocketClient.set_forwarding_latency_measurment(forwarding_latency_measurment) partner_config = WebSocketClient.get_clore_partner_config() if partner_config != None: if self.clore_partner_initiazized == False: