Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/spaceone/core/handler/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,6 +26,7 @@
"mutation": [],
"event": [],
}
_HANDLER_THREAD_LOCK = threading.Lock()

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -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_THREAD_LOCK:
if not _HANDLER_INFO["init"]:
_init_handlers()
_HANDLER_INFO["init"] = True
Loading