032: fix async get_dataset_linked_dashboard_count passed to asyncio.to_thread

get_dataset_linked_dashboard_count is async (coroutine function), but was
passed to asyncio.to_thread() which expects a sync callable. This returned
a coroutine object instead of an int, causing:
  '>' not supported between instances of 'coroutine' and 'int'

Fix: await the async method directly inside asyncio.wait_for().
This commit is contained in:
2026-06-04 23:53:26 +03:00
parent 545eea22f8
commit 87565b8147

View File

@@ -312,9 +312,7 @@ class ResourceService:
async with sem:
try:
return await asyncio.wait_for(
asyncio.to_thread(
client.get_dataset_linked_dashboard_count, ds_id
),
client.get_dataset_linked_dashboard_count(ds_id),
timeout=10.0,
)
except (TimeoutError, Exception):