diff --git a/backend/apps/datasource/api/datasource.py b/backend/apps/datasource/api/datasource.py index 9c182e345..0342ad8d8 100644 --- a/backend/apps/datasource/api/datasource.py +++ b/backend/apps/datasource/api/datasource.py @@ -96,7 +96,10 @@ async def get_tables(session: SessionDep, id: int): @router.post("/getTablesByConf") async def get_tables_by_conf(session: SessionDep, trans: Trans, ds: CoreDatasource): try: - return getTablesByDs(session, ds) + def inner(): + return getTablesByDs(session, ds) + + await asyncio.to_thread(inner) except Exception as e: # check ds status def inner(): @@ -111,7 +114,10 @@ def inner(): @router.post("/getSchemaByConf") async def get_schema_by_conf(session: SessionDep, trans: Trans, ds: CoreDatasource): try: - return get_schema(ds) + def inner(): + return get_schema(ds) + + await asyncio.to_thread(inner) except Exception as e: # check ds status def inner():