revert Added notifications!!

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-03 21:57:29 -06:00
parent fef8ab225d
commit 3f0d264676
24 changed files with 20 additions and 3596 deletions

View File

@@ -1,13 +1,11 @@
"""
Punto de entrada principal para VoxPopuli Microservices
Ejecuta tres APIs en paralelo: Usuarios (puerto 8000), Reportes (puerto 8001) y Notificaciones (puerto 8002)
Ejecuta dos APIs en paralelo: Usuarios (puerto 8000) y Reportes (puerto 8001)
"""
from infrastructure.api.users.app import create_app as create_users_app
from infrastructure.api.reports.app import create_app as create_reports_app
from infrastructure.api.notifications.app import create_app as create_notifications_app
from consumers.report_consumer import ReportConsumer
from consumers.user_consumer import UserConsumer
from consumers.notification_consumer import NotificationConsumer
from core.config import ConfSettings
import threading
import uvicorn
@@ -34,17 +32,6 @@ def run_reports_api():
log_level=ConfSettings.log_level,
)
def run_notifications_api():
"""Ejecuta la API de Notificaciones en puerto 8002"""
app_notifications = create_notifications_app()
uvicorn.run(
app_notifications,
host=ConfSettings.host,
port=8002,
reload=False,
log_level=ConfSettings.log_level,
)
def run_user_consumer():
consumer = UserConsumer()
consumer.start()
@@ -53,10 +40,6 @@ def run_reports_consumer():
consumer = ReportConsumer()
consumer.start()
def run_notifications_consumer():
consumer = NotificationConsumer()
consumer.start()
def run():
"""Inicia ambas APIs en threads separados"""
@@ -66,32 +49,25 @@ def run():
users_thread = threading.Thread(target=run_users_api, daemon=True, name="Users-API")
reports_thread = threading.Thread(target=run_reports_api, daemon=True, name="Reports-API")
notifications_thread = threading.Thread(target=run_notifications_api, daemon=True, name="Notifications-API")
user_consumer_thread = threading.Thread(target=run_user_consumer, daemon=True, name="Users-Consumer")
report_consumer_thread = threading.Thread(target=run_reports_consumer, daemon=True, name="Reports-Consumer")
notifications_consumer_thread = threading.Thread(target=run_notifications_consumer, daemon=True, name="Notifications-Consumer")
users_thread.start()
reports_thread.start()
notifications_thread.start()
user_consumer_thread.start()
report_consumer_thread.start()
notifications_consumer_thread.start()
print("\n✓ API de Usuarios ejecutándose en http://0.0.0.0:8000")
print("✓ API de Reportes ejecutándose en http://0.0.0.0:8001")
print("✓ API de Notificaciones ejecutándose en http://0.0.0.0:8002")
print("\nDocumentación disponible en:")
print(" - Usuarios: http://localhost:8000/docs")
print(" - Reportes: http://localhost:8001/docs")
print(" - Notificaciones: http://localhost:8002/docs")
print("\n" + "=" * 60 + "\n")
try:
users_thread.join()
reports_thread.join()
notifications_thread.join()
except KeyboardInterrupt:
print("\n\nRecibiendo señal de salida...")
print("Cerrando APIs...")