From be9de88eeb4695b077801d3d7fb23259338c22e9 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 4 Oct 2024 15:24:16 +0200 Subject: [PATCH] fix: ensure data update runs during app init Moved `update_data` invocation to the initialization phase of the application rather than relying on the condition of running as the main module. This change ensures data is updated consistently, regardless of whether the app is run via a WSGI server or directly. This addresses initialization issues encountered in certain deployment scenarios. --- src/structables/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/structables/main.py b/src/structables/main.py index 13d952a..7dae69c 100644 --- a/src/structables/main.py +++ b/src/structables/main.py @@ -14,6 +14,7 @@ app.config.from_object(Config) app.typesense_api_key = get_typesense_api_key() init_routes(app) +update_data(app) def background_update_data(app): @@ -40,6 +41,3 @@ def main(): if __name__ == "__main__": main() -else: - # Even if we're using a wsgi server, we still have to initialize global_ibles - update_data(app)