24 lines
536 B
Python
24 lines
536 B
Python
"""Celery 配置"""
|
|
from celery import Celery
|
|
from app.core.config import settings
|
|
|
|
celery_app = Celery(
|
|
"h3c_onu_ms",
|
|
broker=settings.REDIS_URL,
|
|
backend=settings.REDIS_URL
|
|
)
|
|
|
|
celery_app.conf.update(
|
|
task_serializer='json',
|
|
result_serializer='json',
|
|
accept_content=['json'],
|
|
timezone='UTC',
|
|
enable_utc=True,
|
|
beat_schedule={
|
|
'check-devices-every-30-minutes': {
|
|
'task': 'app.tasks.check_tasks.check_all_devices',
|
|
'schedule': settings.CHECK_INTERVAL,
|
|
},
|
|
},
|
|
)
|