Skip to content

Commit

Permalink
update logging and remove code
Browse files Browse the repository at this point in the history
  • Loading branch information
T0biii committed Apr 3, 2024
1 parent c008cca commit c1026f6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions wgkex/broker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ def wg_api_v2_gateway_best() -> Tuple[Response | Dict, int]:
gateway = "all"
logger.info(f"wg_api_v2_gateway_best: Domain: {domain}")


best_worker, diff, current_peers = worker_metrics.get_best_worker(domain)
if best_worker is None:
logger.warning(f"No worker online for domain {domain}")
Expand All @@ -211,16 +210,8 @@ def wg_api_v2_gateway_best() -> Tuple[Response | Dict, int]:
}
}, 400

# Update number of peers locally to interpolate data between MQTT updates from the worker
# TODO fix data race
current_peers_domain = (
worker_metrics.get(best_worker)
.get_domain_metrics(domain)
.get(CONNECTED_PEERS_METRIC, 0)
)

logger.debug(
f"Chose worker {best_worker} with {current_peers} connected clients ({diff})"
f"Should Chose worker {best_worker} with {current_peers} connected clients ({diff})"
)

w_data = worker_data.get((best_worker, domain), None)
Expand Down

0 comments on commit c1026f6

Please sign in to comment.