From 87565b8147b9ad7e93856ebcbca376b8acf75d71 Mon Sep 17 00:00:00 2001 From: busya Date: Thu, 4 Jun 2026 23:53:26 +0300 Subject: [PATCH] 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(). --- backend/src/services/resource_service.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/services/resource_service.py b/backend/src/services/resource_service.py index 87ea2c11..9cb723ec 100644 --- a/backend/src/services/resource_service.py +++ b/backend/src/services/resource_service.py @@ -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):