more minor changes
This commit is contained in:
@@ -110,11 +110,36 @@ class MetricsConsumer:
|
|||||||
try:
|
try:
|
||||||
# Start consumers in separate threads
|
# Start consumers in separate threads
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
def start_user_consumer():
|
||||||
|
try:
|
||||||
|
self.user_consumer.start_consuming()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error en user consumer: {e}")
|
||||||
|
|
||||||
|
def start_report_consumer():
|
||||||
|
try:
|
||||||
|
self.report_consumer.start_consuming()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error en report consumer: {e}")
|
||||||
|
|
||||||
|
def start_notification_consumer():
|
||||||
|
try:
|
||||||
|
self.notification_consumer.start_consuming()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error en notification consumer: {e}")
|
||||||
|
|
||||||
|
def start_moderation_consumer():
|
||||||
|
try:
|
||||||
|
self.moderation_consumer.start_consuming()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error en moderation consumer: {e}")
|
||||||
|
|
||||||
threads = [
|
threads = [
|
||||||
threading.Thread(target=self.user_consumer.start, daemon=True),
|
threading.Thread(target=start_user_consumer, daemon=True),
|
||||||
threading.Thread(target=self.report_consumer.start, daemon=True),
|
threading.Thread(target=start_report_consumer, daemon=True),
|
||||||
threading.Thread(target=self.notification_consumer.start, daemon=True),
|
threading.Thread(target=start_notification_consumer, daemon=True),
|
||||||
threading.Thread(target=self.moderation_consumer.start, daemon=True),
|
threading.Thread(target=start_moderation_consumer, daemon=True),
|
||||||
]
|
]
|
||||||
for t in threads:
|
for t in threads:
|
||||||
t.start()
|
t.start()
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class NotificationConsumer:
|
|||||||
"""Start consuming messages from RabbitMQ"""
|
"""Start consuming messages from RabbitMQ"""
|
||||||
try:
|
try:
|
||||||
logger.info("Starting Notification Consumer...")
|
logger.info("Starting Notification Consumer...")
|
||||||
self.consumer.start()
|
self.consumer.start_consuming()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error starting notification consumer: {e}", exc_info=True)
|
logger.error(f"Error starting notification consumer: {e}", exc_info=True)
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -81,6 +81,12 @@ class Settings(BaseSettings):
|
|||||||
description="Calidad de compresión WebP (0-100)"
|
description="Calidad de compresión WebP (0-100)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# CORS Configuration
|
||||||
|
cors_origins: list = Field(
|
||||||
|
default=["http://localhost:3000", "http://localhost:8000", "http://localhost:8001", "http://localhost:8002", "http://localhost:8003", "http://localhost:8004"],
|
||||||
|
description="Orígenes permitidos para CORS"
|
||||||
|
)
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
env_file = ".env"
|
env_file = ".env"
|
||||||
case_sensitive = False
|
case_sensitive = False
|
||||||
|
|||||||
Reference in New Issue
Block a user