lavkach3
1import inspect2from typing import Callable, Any3
4from core.helpers.cache.base import BaseKeyMaker5
6
7class CustomKeyMaker(BaseKeyMaker):8async def make(self, *, function: Callable, prefix: str) -> str:9path = f"{prefix}:{inspect.getmodule(function).__name__}.{function.__name__}" # type: ignore10args = ""11
12for arg in inspect.signature(function).parameters.values():13args += arg.name14
15if args:16return f"{path}.{args}"17
18return path19
20cache_kay_maker = CustomKeyMaker()21