Feature/windows notifications #7

Merged
florian merged 5 commits from feature/windows-notifications into main 2026-10-13 07:51:37 +00:00
2 changed files with 11 additions and 11 deletions
Showing only changes of commit 1254ac8cc4 - Show all commits

No files matched your search

+4 -4
View File
@@ -20,10 +20,6 @@ import os
logger = setup_logger(__name__) logger = setup_logger(__name__)
api_key_header_internal = APIKeyHeader(name="X-API-Key-Internal") 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 MAX_PAGES = 5
class Notification(BaseModel): class Notification(BaseModel):
@@ -48,6 +44,10 @@ async def lifespan(app: FastAPI):
logger.info("MySQL healthcheck thread started.") logger.info("MySQL healthcheck thread started.")
producer = RabbitMQProducer() producer = RabbitMQProducer()
PULL_SERVICE_URL = os.getenv(
"BACKEND_PULL_NOTIFICATIONS_URL",
"http://backend-pull-notifications.app-notifications.svc.cluster.local:8101",
)
try: try:
logger.info("Starting RabbitMQ producer...") logger.info("Starting RabbitMQ producer...")
+7 -7
View File
@@ -31,13 +31,13 @@ class RabbitMQProducer:
the pull key per user. the pull key per user.
""" """
def __init__(self): def __init__(self):
self.rmq_host = os.getenv("BACKEND_API_INTERNAL_RMQ_HOST", "localhost") self.rmq_host = os.getenv("RMQ_HOST", "localhost")
self.rmq_vhost = os.getenv("BACKEND_API_INTERNAL_RMQ_VHOST", "app_notifications") self.rmq_vhost = os.getenv("RMQ_VHOST", "app_notifications")
self.rmq_exchange = os.getenv("BACKEND_API_INTERNAL_RMQ_EXCHANGE", "app_notifications") self.rmq_exchange = os.getenv("RMQ_EXCHANGE", "app_notifications")
self.pull_routing_prefix = os.getenv("BACKEND_PULL_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.pull") self.pull_routing_prefix = os.getenv("PULL_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.pull")
self.push_routing_prefix = os.getenv("BACKEND_PUSH_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.user") self.push_routing_prefix = os.getenv("PUSH_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.user")
self.pull_queue_prefix = os.getenv("BACKEND_PULL_NOTIFICATIONS_RMQ_QUEUE_PREFIX", "notifications-pull") self.pull_queue_prefix = os.getenv("PULL_NOTIFICATIONS_RMQ_QUEUE_PREFIX", "notifications-pull")
self.push_queue_name = os.getenv("BACKEND_PUSH_NOTIFICATIONS_RMQ_QUEUE", "notifications") self.push_queue_name = os.getenv("PUSH_NOTIFICATIONS_RMQ_QUEUE", "notifications")
self.connection: aio_pika.RobustConnection | None = None self.connection: aio_pika.RobustConnection | None = None
self.channel: aio_pika.RobustChannel | None = None self.channel: aio_pika.RobustChannel | None = None