Implementacion de sistema distribuido de boton de ayuda
This commit is contained in:
@@ -3,18 +3,25 @@ from celery import Celery
|
||||
|
||||
|
||||
valkey_url = os.getenv("VALKEY_URL", "redis://valkey:6379/0")
|
||||
print(f"DEBUG: Celery Broker URL: {valkey_url}")
|
||||
|
||||
# Configurar broker y backend explícitamente en el constructor
|
||||
celery_app = Celery(
|
||||
"anexo76_tasks",
|
||||
broker=valkey_url,
|
||||
backend=valkey_url,
|
||||
)
|
||||
celery_app.set_default()
|
||||
|
||||
celery_app.conf.update(
|
||||
include=[
|
||||
"api.v1.modules.a76.reports.importacion.facturas.task",
|
||||
"api.v1.modules.a76.reports.importacion.consolidados.task",
|
||||
"api.v1.modules.a76.reports.importacion.packing_list.task",
|
||||
"api.v1.modules.a76.reports.exportacion.aviso_consolidado.task",
|
||||
"api.v1.modules.a76.reports.exportacion.descargo.task",
|
||||
"api.v1.modules.a76.imports.tasks"
|
||||
"api.v1.modules.a76.imports.tasks",
|
||||
"api.v1.modules.core.help_center.tasks"
|
||||
] # Ruta al módulo donde están las tareas
|
||||
)
|
||||
|
||||
@@ -28,5 +35,12 @@ celery_app.conf.update(
|
||||
enable_utc=True,
|
||||
)
|
||||
|
||||
celery_app.conf.beat_schedule = {
|
||||
"sync-from-hub-every-minute": {
|
||||
"task": "sync_from_hub_task",
|
||||
"schedule": 60.0, # Run every 60 seconds
|
||||
},
|
||||
}
|
||||
|
||||
if __name__ == "__main__":
|
||||
celery_app.start()
|
||||
Reference in New Issue
Block a user