mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-26 17:51:54 +01:00
@lru_cache on fetch_versioned_implementation (#1178)
This commit is contained in:
parent
a7c820147e
commit
0b0665044f
@ -1,3 +1,4 @@
|
||||
import functools
|
||||
import importlib
|
||||
from typing import Any
|
||||
|
||||
@ -16,6 +17,7 @@ class DanswerVersion:
|
||||
global_version = DanswerVersion()
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=128)
|
||||
def fetch_versioned_implementation(module: str, attribute: str) -> Any:
|
||||
module_full = f"ee.{module}" if global_version.get_is_ee_version() else module
|
||||
return getattr(importlib.import_module(module_full), attribute)
|
||||
|
Loading…
x
Reference in New Issue
Block a user