From da496f8ca261cad8f9748d089ddadeaca800712e Mon Sep 17 00:00:00 2001 From: Andrew Shu Date: Sat, 23 Aug 2025 12:13:00 -0700 Subject: [PATCH] Fix redis consumers crashing due to relative path error Specify absolute path to openapi_beta.yaml in routes.py Consumers use a different working directory /opt/tildes/consumers --- tildes/tildes/routes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tildes/tildes/routes.py b/tildes/tildes/routes.py index ea77bba..47cd54f 100644 --- a/tildes/tildes/routes.py +++ b/tildes/tildes/routes.py @@ -16,6 +16,9 @@ from tildes.resources.topic import topic_by_id36 from tildes.resources.user import user_by_username +OPENAPI_YAML_FILE = "/opt/tildes/openapi_beta.yaml" + + def includeme(config: Configurator) -> None: """Set up application routes.""" config.add_route("home", "/") @@ -130,7 +133,7 @@ def includeme(config: Configurator) -> None: # Routes for the JSON API # We also provide a path for the full spec and the built-in swagger UI explorer - config.pyramid_openapi3_spec("openapi_beta.yaml", route="/api/beta/openapi.yaml") + config.pyramid_openapi3_spec(OPENAPI_YAML_FILE, route="/api/beta/openapi.yaml") config.pyramid_openapi3_add_explorer(route="/api/beta/ui") with config.route_prefix_context("/api/beta"):