refactor: Replace asynchronous service calls with synchronous counterparts in SaveImage and ServiceRegistry. Fixes #282

This commit is contained in:
Will Miao
2025-07-11 22:48:39 +08:00
parent 5de16a78c5
commit bd95e802ec
2 changed files with 18 additions and 24 deletions

View File

@@ -38,6 +38,15 @@ class ServiceRegistry:
return None
return registry._services[service_name]
@classmethod
def get_service_sync(cls, service_name: str) -> Any:
"""Get a service instance by name (synchronous version)"""
registry = cls.get_instance()
if service_name not in registry._services:
logger.debug(f"Service {service_name} not found in registry")
return None
return registry._services[service_name]
# Convenience methods for common services
@classmethod
async def get_lora_scanner(cls):