feature/T2026-05-016 implementar cargas de tareas en background e implementar y corregir auditoria para datastages
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
from celery import Celery
|
||||
from datetime import timedelta
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||
|
||||
app = Celery('config')
|
||||
app.config_from_object('django.conf:settings', namespace='CELERY')
|
||||
# corroborar que las tareas esten programadas, se cambio el horario a hora denver
|
||||
# print("Beat schedule cargado:", app.conf.beat_schedule)
|
||||
app.autodiscover_tasks()
|
||||
|
||||
@@ -30,8 +30,14 @@ from celery.schedules import crontab
|
||||
from config.stg.storage import *
|
||||
|
||||
CELERY_BEAT_SCHEDULE = {
|
||||
|
||||
|
||||
'process_all_organizations': {
|
||||
'task': 'api.customs.tasks.microservice_v2.process_all_organizations',
|
||||
'schedule': crontab(hour=7, minute=1), # analizar si se requiere otra en un futuro
|
||||
},
|
||||
# 'process_all_organizations': {
|
||||
# 'task': 'api.customs.tasks.microservice_v2.process_all_organizations',
|
||||
# 'schedule': crontab(hour=11, minute=39), # analizar si se requiere otra en un futuro
|
||||
# },
|
||||
}
|
||||
|
||||
# Cargar variables de entorno desde un archivo .env
|
||||
@@ -305,7 +311,8 @@ DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
||||
# Configuración Celery
|
||||
CELERY_BROKER_URL = os.getenv('CELERY_BROKER_URL', 'redis://redis:6379/0')
|
||||
CELERY_RESULT_BACKEND = os.getenv('CELERY_RESULT_BACKEND', 'redis://redis:6379/0')
|
||||
CELERY_TIMEZONE = 'America/Mexico_City'
|
||||
# CELERY_TIMEZONE = 'America/Mexico_City'
|
||||
CELERY_TIMEZONE = 'America/Denver'
|
||||
|
||||
# Configuración para procesamiento asíncrono nativo de Django
|
||||
ASGI_APPLICATION = 'config.asgi.application'
|
||||
|
||||
Reference in New Issue
Block a user