chore: cache decoratorでfunctools.wrapsを使うように

feat/v13/notes
yupix 10 months ago
parent b40199ea18
commit 74fc00355a
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -1,4 +1,5 @@
from functools import lru_cache
import functools
from typing import Any
DEFAULT_CACHE: dict[str, list[str]] = {}
@ -18,6 +19,7 @@ def set_cache(group: str, key: str, value: Any):
def cache(group: str = "default", override: bool = False):
def decorator(func):
@functools.wraps(func)
async def wrapper(self, *args, **kwargs):
key = cache_key_builder(func, self, *args, **kwargs)
hit_item = DEFAULT_CACHE_VALUE.get(key)

Loading…
Cancel
Save