Shorter variable names
This commit is contained in:
1 parent
8aec7bafce
commit
1254ac8cc4
2 files changed
+11
-11
No files matched your search
+4
-4
@@ -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...")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user