"...git@developer.sourcefind.cn:2222/OpenDAS/vllm_cscc.git" did not exist on "a1946570d80c1bef78063e84b097951d8e8d4e6a"
Unverified Commit 25f9c789 authored by youkaichao's avatar youkaichao Committed by GitHub
Browse files

[misc][plugin] improve plugin loading (#10443)


Signed-off-by: default avataryoukaichao <youkaichao@gmail.com>
parent 5390d666
...@@ -9,12 +9,19 @@ if TYPE_CHECKING: ...@@ -9,12 +9,19 @@ if TYPE_CHECKING:
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# make sure one process only loads plugins once
plugins_loaded = False
def load_general_plugins(): def load_general_plugins():
"""WARNING: plugins can be loaded for multiple times in different """WARNING: plugins can be loaded for multiple times in different
processes. They should be designed in a way that they can be loaded processes. They should be designed in a way that they can be loaded
multiple times without causing issues. multiple times without causing issues.
""" """
global plugins_loaded
if plugins_loaded:
return
plugins_loaded = True
import sys import sys
if sys.version_info < (3, 10): if sys.version_info < (3, 10):
from importlib_metadata import entry_points from importlib_metadata import entry_points
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment