From 531eb1f0283291edb58892bda1db60c84a289963 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 19 Dec 2023 17:43:17 +0300 Subject: [PATCH] precache-authors-2 --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 8fecc14..a2c1a95 100644 --- a/main.py +++ b/main.py @@ -19,6 +19,10 @@ schema = make_executable_schema(load_schema_from_path("inbox.graphql"), resolver async def start_up(): + # load authors cache + authors = await get_all_authors() + print(f"[main] {len(authors)} authors precached") + if MODE == "dev": if exists(DEV_SERVER_PID_FILE_NAME): await redis.connect() @@ -29,9 +33,6 @@ async def start_up(): else: await redis.connect() - # load authors cache - authors = await get_all_authors() - print(f"[main] {len(authors)} authors precached") # startup sentry monitoring services try: import sentry_sdk