MCPcopy Index your code
hub / github.com/dataease/SQLBot / _get_lock

Method _get_lock

backend/apps/ai_model/embedding.py:40–49  ·  view source on GitHub ↗
(key: str = settings.DEFAULT_EMBEDDING_MODEL)

Source from the content-addressed store, hash-verified

38
39 @staticmethod
40 def _get_lock(key: str = settings.DEFAULT_EMBEDDING_MODEL):
41 lock = locks.get(key)
42 if lock is None:
43 with _lock:
44 lock = locks.get(key)
45 if lock is None:
46 lock = threading.Lock()
47 locks[key] = lock
48
49 return lock
50
51 @staticmethod
52 def get_model(key: str = settings.DEFAULT_EMBEDDING_MODEL,

Callers 1

get_modelMethod · 0.80

Calls 1

getMethod · 0.65

Tested by

no test coverage detected