From 6c4aa99eb7e7689217a9a60cda01ac8f990723a5 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Fri, 1 Dec 2023 16:09:21 -0300 Subject: [PATCH] Fix more bugs --- flights-domain/flights-information/requirements.txt | 5 ++--- gateway/requirements.txt | 5 ++--- gateway/src/api/main.py | 3 +++ subscription-domain/.env.dev.example | 2 +- subscription-domain/.env.prod.example | 2 +- subscription-domain/docker-template.yml | 2 +- subscription-domain/subscription-manager/requirements.txt | 5 ++--- subscription-domain/subscription-manager/src/api/config.py | 7 ++++++- .../subscription-manager/src/api/utils/telegram.py | 2 +- 9 files changed, 19 insertions(+), 14 deletions(-) diff --git a/flights-domain/flights-information/requirements.txt b/flights-domain/flights-information/requirements.txt index e03e064..a781eb0 100644 --- a/flights-domain/flights-information/requirements.txt +++ b/flights-domain/flights-information/requirements.txt @@ -4,6 +4,5 @@ psycopg2-binary==2.9.5 pyjwt==2.6.0 gunicorn==20.1.0 sqlalchemy==2.0.22 -asyncreq==0.0.5 -logmiddleware==0.0.3 -async-timeout==4.0.3 \ No newline at end of file +asyncreq==0.0.6 +logmiddleware==0.0.4 \ No newline at end of file diff --git a/gateway/requirements.txt b/gateway/requirements.txt index 21811f2..6825e9d 100644 --- a/gateway/requirements.txt +++ b/gateway/requirements.txt @@ -3,6 +3,5 @@ fastapi[all]==0.103.2 pyjwt==2.6.0 gunicorn==20.1.0 requests==2.31.0 -asyncreq==0.0.5 -logmiddleware==0.0.3 -async-timeout==4.0.3 \ No newline at end of file +asyncreq==0.0.6 +logmiddleware==0.0.4 \ No newline at end of file diff --git a/gateway/src/api/main.py b/gateway/src/api/main.py index 771e61c..a03bd2c 100644 --- a/gateway/src/api/main.py +++ b/gateway/src/api/main.py @@ -7,6 +7,9 @@ from logmiddleware import RouterLoggingMiddleware, logging_config from src.api.config import API_DEBUG from src.api.routes import auth, flights, health, notifications, subscriptions, users +# from src.api.log import RouterLoggingMiddleware, logging_config + + logging.config.dictConfig(logging_config) logger = logging.getLogger(__name__) diff --git a/subscription-domain/.env.dev.example b/subscription-domain/.env.dev.example index 767bf67..a4d18bb 100644 --- a/subscription-domain/.env.dev.example +++ b/subscription-domain/.env.dev.example @@ -2,5 +2,5 @@ POSTGRES_USER=user POSTGRES_PASS=password POSTGRES_DB=api_dev APP_SETTINGS=src.config.DevelopmentConfig -TOKEN=3275588851:AT36AGy_BChQUuCq2M6d2UrY5CSWtZe45gV +TG_TOKEN=3275588851:AT36AGy_BChQUuCq2M6d2UrY5CSWtZe45gV API_DEBUG=true \ No newline at end of file diff --git a/subscription-domain/.env.prod.example b/subscription-domain/.env.prod.example index 0078a52..bcb062a 100644 --- a/subscription-domain/.env.prod.example +++ b/subscription-domain/.env.prod.example @@ -2,5 +2,5 @@ POSTGRES_USER=user POSTGRES_PASS=password POSTGRES_DB=api_prod APP_SETTINGS=src.config.ProductionConfig -TOKEN=3275588851:AT36AGy_BChQUuCq2M6d2UrY5CSWtZe45gV +TG_TOKEN=3275588851:AT36AGy_BChQUuCq2M6d2UrY5CSWtZe45gV API_DEBUG=false \ No newline at end of file diff --git a/subscription-domain/docker-template.yml b/subscription-domain/docker-template.yml index a2d693e..527a8f2 100644 --- a/subscription-domain/docker-template.yml +++ b/subscription-domain/docker-template.yml @@ -15,7 +15,7 @@ services: - PORT=5000 - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@subscriptions-db/${POSTGRES_DB} - APP_SETTINGS=${APP_SETTINGS} - - TOKEN=${TOKEN} + - TG_TOKEN=${TG_TOKEN} logging: driver: gelf options: diff --git a/subscription-domain/subscription-manager/requirements.txt b/subscription-domain/subscription-manager/requirements.txt index e03e064..a781eb0 100644 --- a/subscription-domain/subscription-manager/requirements.txt +++ b/subscription-domain/subscription-manager/requirements.txt @@ -4,6 +4,5 @@ psycopg2-binary==2.9.5 pyjwt==2.6.0 gunicorn==20.1.0 sqlalchemy==2.0.22 -asyncreq==0.0.5 -logmiddleware==0.0.3 -async-timeout==4.0.3 \ No newline at end of file +asyncreq==0.0.6 +logmiddleware==0.0.4 \ No newline at end of file diff --git a/subscription-domain/subscription-manager/src/api/config.py b/subscription-domain/subscription-manager/src/api/config.py index 8b894cf..ea64a9e 100644 --- a/subscription-domain/subscription-manager/src/api/config.py +++ b/subscription-domain/subscription-manager/src/api/config.py @@ -1,4 +1,9 @@ import os -API_FLIGHTS = "http://fids_flights_api:5000/flights" +TEST_TARGET = os.getenv("TEST_TARGET") API_DEBUG = os.getenv("API_DEBUG") + +if TEST_TARGET == "INTEGRATION": + API_FLIGHTS = "http://fids-flights-dev_flights-api:5000/flights" +else: + API_FLIGHTS = "http://fids-flights_flights-api:5000/flights" diff --git a/subscription-domain/subscription-manager/src/api/utils/telegram.py b/subscription-domain/subscription-manager/src/api/utils/telegram.py index 7795b53..13c930c 100644 --- a/subscription-domain/subscription-manager/src/api/utils/telegram.py +++ b/subscription-domain/subscription-manager/src/api/utils/telegram.py @@ -2,7 +2,7 @@ import os from asyncreq import request -TOKEN = os.getenv("TOKEN") +TOKEN = os.getenv("TG_TOKEN") async def send_message(chat_id, message):