From 1254ac8cc49aae2f63dd47963c01a693963f941d Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 13 Oct 2026 09:20:31 +0200 Subject: [PATCH] Shorter variable names --- src/main.py | 8 ++++---- src/rabbitmq_handler.py | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 18477f8..568eb57 100644 --- a/src/main.py +++ b/src/main.py @@ -20,10 +20,6 @@ import os logger = setup_logger(__name__) api_key_header_internal = APIKeyHeader(name="X-API-Key-Internal") -PULL_SERVICE_URL = os.getenv( - "BACKEND_PULL_NOTIFICATIONS_URL", - "http://backend-pull-notifications.app-notifications.svc.cluster.local:8101", -) MAX_PAGES = 5 class Notification(BaseModel): @@ -48,6 +44,10 @@ async def lifespan(app: FastAPI): logger.info("MySQL healthcheck thread started.") producer = RabbitMQProducer() + PULL_SERVICE_URL = os.getenv( + "BACKEND_PULL_NOTIFICATIONS_URL", + "http://backend-pull-notifications.app-notifications.svc.cluster.local:8101", + ) try: logger.info("Starting RabbitMQ producer...") diff --git a/src/rabbitmq_handler.py b/src/rabbitmq_handler.py index 3ea9b95..ce372ee 100644 --- a/src/rabbitmq_handler.py +++ b/src/rabbitmq_handler.py @@ -31,13 +31,13 @@ class RabbitMQProducer: the pull key per user. """ def __init__(self): - self.rmq_host = os.getenv("BACKEND_API_INTERNAL_RMQ_HOST", "localhost") - self.rmq_vhost = os.getenv("BACKEND_API_INTERNAL_RMQ_VHOST", "app_notifications") - self.rmq_exchange = os.getenv("BACKEND_API_INTERNAL_RMQ_EXCHANGE", "app_notifications") - self.pull_routing_prefix = os.getenv("BACKEND_PULL_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.pull") - self.push_routing_prefix = os.getenv("BACKEND_PUSH_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.user") - self.pull_queue_prefix = os.getenv("BACKEND_PULL_NOTIFICATIONS_RMQ_QUEUE_PREFIX", "notifications-pull") - self.push_queue_name = os.getenv("BACKEND_PUSH_NOTIFICATIONS_RMQ_QUEUE", "notifications") + self.rmq_host = os.getenv("RMQ_HOST", "localhost") + self.rmq_vhost = os.getenv("RMQ_VHOST", "app_notifications") + self.rmq_exchange = os.getenv("RMQ_EXCHANGE", "app_notifications") + self.pull_routing_prefix = os.getenv("PULL_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.pull") + self.push_routing_prefix = os.getenv("PUSH_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.user") + self.pull_queue_prefix = os.getenv("PULL_NOTIFICATIONS_RMQ_QUEUE_PREFIX", "notifications-pull") + self.push_queue_name = os.getenv("PUSH_NOTIFICATIONS_RMQ_QUEUE", "notifications") self.connection: aio_pika.RobustConnection | None = None self.channel: aio_pika.RobustChannel | None = None