diff --git a/platformio/home/rpc/handlers/registry.py b/platformio/home/rpc/handlers/registry.py index fa6f702c..34d0974b 100644 --- a/platformio/home/rpc/handlers/registry.py +++ b/platformio/home/rpc/handlers/registry.py @@ -13,16 +13,17 @@ # limitations under the License. from ajsonrpc.core import JSONRPC20DispatchException +from starlette.concurrency import run_in_threadpool from platformio.registry.client import RegistryClient class RegistryRPC: @staticmethod - def call_client(method, *args, **kwargs): + async def call_client(method, *args, **kwargs): try: client = RegistryClient() - return getattr(client, method)(*args, **kwargs) + return await run_in_threadpool(getattr(client, method), *args, **kwargs) except Exception as exc: # pylint: disable=bare-except raise JSONRPC20DispatchException( code=5000, message="Registry Call Error", data=str(exc)