From a73dc51e25e9097b81ab2fd6421caaa045184d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Tue, 6 Sep 2022 07:55:44 +0000 Subject: [PATCH] allow decorator_args for timed_alru_cache --- api/ovdashboard_api/async_helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/ovdashboard_api/async_helpers.py b/api/ovdashboard_api/async_helpers.py index ddc8919..a4a7ef9 100644 --- a/api/ovdashboard_api/async_helpers.py +++ b/api/ovdashboard_api/async_helpers.py @@ -36,14 +36,14 @@ def get_ttl_hash(seconds: int = 20) -> int: return round(time() / seconds) -def timed_alru_cache(**decorator_kwargs): +def timed_alru_cache(*decorator_args, **decorator_kwargs): """ Decorator which adds an (unused) param `ttl_hash` - and the `@alru_cache` annotation to a function. + and the `alru_cache` annotation to a function. """ def decorate(f): - @alru_cache(**decorator_kwargs) + @alru_cache(*decorator_args, **decorator_kwargs) @wraps(f) async def wrapper(ttl_hash: int, *args, **kwargs): del ttl_hash