mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Merge branch 'dev' into abhi/ci-chromatic
This commit is contained in:
@@ -1097,14 +1097,16 @@ class ExecutionManager(AppProcess):
|
||||
def get_db_client() -> "DatabaseManagerClient":
|
||||
from backend.executor import DatabaseManagerClient
|
||||
|
||||
return get_service_client(DatabaseManagerClient)
|
||||
# Disable health check for the service client to avoid breaking process initializer.
|
||||
return get_service_client(DatabaseManagerClient, health_check=False)
|
||||
|
||||
|
||||
@thread_cached
|
||||
def get_notification_service() -> "NotificationManagerClient":
|
||||
from backend.notifications import NotificationManagerClient
|
||||
|
||||
return get_service_client(NotificationManagerClient)
|
||||
# Disable health check for the service client to avoid breaking process initializer.
|
||||
return get_service_client(NotificationManagerClient, health_check=False)
|
||||
|
||||
|
||||
def send_execution_update(entry: GraphExecution | NodeExecutionResult | None):
|
||||
|
||||
@@ -247,6 +247,7 @@ ASC = TypeVar("ASC", bound=AppServiceClient)
|
||||
def get_service_client(
|
||||
service_client_type: Type[ASC],
|
||||
call_timeout: int | None = api_call_timeout,
|
||||
health_check: bool = True,
|
||||
) -> ASC:
|
||||
class DynamicClient:
|
||||
def __init__(self):
|
||||
@@ -351,7 +352,8 @@ def get_service_client(
|
||||
return sync_method
|
||||
|
||||
client = cast(ASC, DynamicClient())
|
||||
client.health_check()
|
||||
if health_check:
|
||||
client.health_check()
|
||||
|
||||
return client
|
||||
|
||||
|
||||
Reference in New Issue
Block a user