From a3303837d5240835d5c971a2f1fb29e2b2f1634c Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 12 Mar 2024 17:00:20 +0300 Subject: [PATCH] cached-load-fix-2 --- resolvers/author.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resolvers/author.py b/resolvers/author.py index 0e0acad8..94e7141d 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -110,11 +110,11 @@ async def get_author_id(_, _info, user: str): @query.field('load_authors_by') -async def load_authors_by(_, _info, by, limit, offset): - cache_key = f"load_authors_by_{json.dumps(by)}_{limit}_{offset}" +def load_authors_by(_, _info, by, limit, offset): + cache_key = f"{json.dumps(by)}_{limit}_{offset}" @authors_cache_region.cache_on_arguments(cache_key) - async def _load_authors_by(_, _info, by, limit, offset): + def _load_authors_by(): logger.debug(f'loading authors by {by}') q = select(Author) if by.get('slug'): @@ -147,7 +147,7 @@ async def load_authors_by(_, _info, by, limit, offset): return authors - return await _load_authors_by(None, None, by, limit, offset) + return _load_authors_by()