From 39678f011bce87b47f9aa0243de4a2183f786884 Mon Sep 17 00:00:00 2001 From: zchen Date: Tue, 26 Mar 2024 11:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95RABBITMQ=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- app/api/api_test.py | 5 +++-- app/core/config.py | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1131cd..a56015f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,4 +19,4 @@ LABEL maintainer="zchengrong@yeah.net" \ name="trinity_aida" -CMD ["gunicorn", "-c", "gunicorn_config.py", "app.main:app"] \ No newline at end of file +CMD ["gunicorn", "-c", "gunicorn_config.py", "app.main:app" , "-e", "RABBITMQ_QUEUES=123"] \ No newline at end of file diff --git a/app/api/api_test.py b/app/api/api_test.py index cd9df51..9c4772d 100644 --- a/app/api/api_test.py +++ b/app/api/api_test.py @@ -2,13 +2,14 @@ import logging from fastapi import APIRouter +from app.core.config import RABBITMQ_QUEUES + logger = logging.getLogger() router = APIRouter() - - @router.get("") def test(): + logger.info(RABBITMQ_QUEUES) logger.info("test") return {"message": "ok"} diff --git a/app/core/config.py b/app/core/config.py index b55fa65..8b8ce60 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -69,3 +69,5 @@ RABBITMQ_PARAMS = { "credentials": pika.credentials.PlainCredentials(username='rabbit', password='123456'), "virtual_host": "/" } + +RABBITMQ_QUEUES = os.getenv("RABBITMQ_QUEUES", "SuperResolution-local")