2 Commits

Author SHA1 Message Date
9b0821926c fix for cluster manager
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m11s
Run linting on the backend code / Build (pull_request) Failing after 2m22s
Run testing on the backend code / Build (pull_request) Failing after 2m26s
Build and deploy the backend to staging / Deploy to staging (pull_request) Failing after 3h3m27s
2025-11-20 18:48:26 +01:00
0514fa063f suggested fix to avoid UnboundLocalError 2025-11-20 18:47:34 +01:00

View File

@@ -102,9 +102,6 @@ class ClusterManager:
selector = sel, selector = sel,
out = out out = out
) )
except Exception as e:
self.logger.warning(f"Error fetching clusters: {e}")
if result is None : if result is None :
self.logger.debug(f"Found no {cluster_type} clusters, overpass query returned no datapoints.") self.logger.debug(f"Found no {cluster_type} clusters, overpass query returned no datapoints.")
self.valid = False self.valid = False
@@ -149,6 +146,14 @@ class ClusterManager:
self.logger.debug(f"Detected 0 {cluster_type} clusters.") self.logger.debug(f"Detected 0 {cluster_type} clusters.")
self.valid = False self.valid = False
except UnboundLocalError as ule:
self.logger.warning(f"Error fetching clusters due to overpass crash: {ule}")
self.valid = False
except Exception as e:
self.logger.warning(f"Error fetching clusters: {e}")
raise Exception from e
def generate_clusters(self) -> list[Landmark]: def generate_clusters(self) -> list[Landmark]:
""" """