Skip to content

Commit eba1832

Browse files
committed
key change for cache
1 parent 8733f02 commit eba1832

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

backend/routers/lib/cache.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,8 @@ def cache(_, hours=2):
126126
def wrapper(func):
127127
@wraps(func)
128128
async def wrapped(*args, **kwargs):
129-
key_parts = (
130-
[func.__name__]
131-
+ list(args)
132-
+ list(kwargs.keys())
133-
+ list(kwargs.values())
134-
)
135-
key = "-".join(str(k) for k in key_parts)
129+
key_parts = list(args) + list(kwargs.keys()) + list(kwargs.values())
130+
key = f'{[func.__name__]}:{"-".join(str(k) for k in key_parts)}'
136131
result = store.get(key)
137132

138133
if result is None or not production_environment:

0 commit comments

Comments
 (0)