Simplified env variables
This commit is contained in:
1 parent
aa5853f0fa
commit
437a220402
2 files changed
+5
-6
No files matched your search
@@ -6,7 +6,6 @@ import uvicorn
|
||||
from aio_pika.exceptions import AMQPException
|
||||
from fastapi import FastAPI, HTTPException, Request
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.security.api_key import APIKeyHeader
|
||||
from pydantic import BaseModel, Field
|
||||
from starlette.exceptions import HTTPException as StarletteHTTPException
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ logger = setup_logger(__name__)
|
||||
class RabbitMQConsumer:
|
||||
"""Pull-based RabbitMQ consumer. Messages are fetched on demand, one queue per user."""
|
||||
def __init__(self):
|
||||
self.rmq_host = os.getenv("BACKEND_PUSH_NOTIFICATIONS_RMQ_HOST", "localhost")
|
||||
self.rmq_vhost = os.getenv("BACKEND_PUSH_NOTIFICATIONS_RMQ_VHOST", "app_notifications")
|
||||
self.rmq_exchange = os.getenv("BACKEND_PUSH_NOTIFICATIONS_RMQ_EXCHANGE", "app_notifications")
|
||||
self.pull_queue_prefix = os.getenv("BACKEND_PULL_NOTIFICATIONS_RMQ_QUEUE_PREFIX", "notifications-pull")
|
||||
self.pull_routing_prefix = os.getenv("BACKEND_PULL_NOTIFICATIONS_RMQ_ROUTING_PREFIX", "notify.pull")
|
||||
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_queue_prefix = os.getenv("RMQ_QUEUE_PREFIX", "notifications-pull")
|
||||
self.pull_routing_prefix = os.getenv("RMQ_ROUTING_PREFIX", "notify.pull")
|
||||
|
||||
self._user_locks: weakref.WeakValueDictionary[int, asyncio.Lock] = weakref.WeakValueDictionary()
|
||||
self.connection: aio_pika.RobustConnection | None = None
|
||||
|
||||
Reference in new issue
Block a user