032: fix health_service _prime_dashboard_meta_cache — async get_dashboards_summary
_prime_dashboard_meta_cache was sync but called async get_dashboards_summary(). Parent get_health_summary was already async def. Made child async + added awaits.
This commit is contained in:
@@ -72,7 +72,7 @@ class HealthService:
|
||||
# @RELATION DEPENDS_ON ->[ValidationRecord]
|
||||
# @RELATION DEPENDS_ON ->[ConfigManager]
|
||||
# @RELATION DEPENDS_ON ->[SupersetClient]
|
||||
def _prime_dashboard_meta_cache(self, records: list[ValidationRecord]) -> None:
|
||||
async def _prime_dashboard_meta_cache(self, records: list[ValidationRecord]) -> None:
|
||||
if not self.config_manager or not records:
|
||||
return
|
||||
|
||||
@@ -121,7 +121,7 @@ class HealthService:
|
||||
)
|
||||
dashboard_meta_map = cached_meta_data[1]
|
||||
else:
|
||||
dashboards = SupersetClient(env).get_dashboards_summary()
|
||||
dashboards = await SupersetClient(env).get_dashboards_summary()
|
||||
dashboard_meta_map = {
|
||||
str(item.get("id")): {
|
||||
"slug": item.get("slug"),
|
||||
@@ -221,7 +221,7 @@ class HealthService:
|
||||
|
||||
records = query.all()
|
||||
|
||||
self._prime_dashboard_meta_cache(records)
|
||||
await self._prime_dashboard_meta_cache(records)
|
||||
|
||||
items = []
|
||||
pass_count = 0
|
||||
|
||||
Reference in New Issue
Block a user