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")