diff --git a/src/spaceone/core/handler/__init__.py b/src/spaceone/core/handler/__init__.py index d45e92f..713ab1f 100644 --- a/src/spaceone/core/handler/__init__.py +++ b/src/spaceone/core/handler/__init__.py @@ -1,5 +1,6 @@ import abc import logging +import threading from typing import List from spaceone.core.base import CoreObject from spaceone.core import config @@ -25,6 +26,7 @@ "mutation": [], "event": [], } +_HANDLER_INIT_LOCK = threading.Lock() _LOGGER = logging.getLogger(__name__) @@ -145,5 +147,7 @@ def get_event_handlers() -> List[BaseEventHandler]: def _check_init_state() -> None: if not _HANDLER_INFO["init"]: - _init_handlers() - _HANDLER_INFO["init"] = True + with _HANDLER_INIT_LOCK: + if not _HANDLER_INFO["init"]: + _init_handlers() + _HANDLER_INFO["init"] = True diff --git a/src/spaceone/core/pygrpc/client.py b/src/spaceone/core/pygrpc/client.py index b588dce..35fd2d7 100644 --- a/src/spaceone/core/pygrpc/client.py +++ b/src/spaceone/core/pygrpc/client.py @@ -37,7 +37,7 @@ def __init__( self._request_map = request_map self._channel_key = channel_key self.metadata = options.get("metadata", {}) - self.timeout = timeout or 60 + self.timeout = timeout or 180 def _check_message(self, client_call_details, request_or_iterator, is_stream): if client_call_details.method in self._request_map: