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 0cb8277 commit c464b92Copy full SHA for c464b92
packages/service-library/src/servicelib/redis/_semaphore_lua.py
@@ -13,10 +13,12 @@
13
>>> my_acquire_script(keys=[...], args=[...])
14
"""
15
16
+from functools import lru_cache
17
from importlib import resources
18
from typing import Final
19
20
21
+@lru_cache
22
def _load_script(script_name: str) -> str:
23
with resources.path("servicelib.redis.lua", f"{script_name}.lua") as script_file:
24
return script_file.read_text(encoding="utf-8").strip()
0 commit comments