We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 821f422 commit 3671e68Copy full SHA for 3671e68
src/spaceone/core/handler/__init__.py
@@ -1,5 +1,6 @@
1
import abc
2
import logging
3
+import threading
4
from typing import List
5
from spaceone.core.base import CoreObject
6
from spaceone.core import config
@@ -25,6 +26,7 @@
25
26
"mutation": [],
27
"event": [],
28
}
29
+_HANDLER_THREAD_LOCK = threading.Lock()
30
31
_LOGGER = logging.getLogger(__name__)
32
@@ -145,5 +147,7 @@ def get_event_handlers() -> List[BaseEventHandler]:
145
147
146
148
def _check_init_state() -> None:
149
if not _HANDLER_INFO["init"]:
- _init_handlers()
- _HANDLER_INFO["init"] = True
150
+ with _HANDLER_THREAD_LOCK:
151
+ if not _HANDLER_INFO["init"]:
152
+ _init_handlers()
153
+ _HANDLER_INFO["init"] = True
0 commit comments