feat(auto-upgrade): celery scheduled task

This commit is contained in:
Junyan Qin
2025-05-19 15:08:47 +08:00
parent 71b3d6ad9c
commit 8b62e5520a
2 changed files with 130 additions and 0 deletions

View File

@ -72,6 +72,7 @@ def init_app(app: DifyApp) -> Celery:
"schedule.clean_messages",
"schedule.mail_clean_document_notify_task",
"schedule.queue_monitor_task",
"schedule.check_upgradable_plugin_task",
]
day = dify_config.CELERY_BEAT_SCHEDULER_TIME
beat_schedule = {
@ -106,6 +107,11 @@ def init_app(app: DifyApp) -> Celery:
minutes=dify_config.QUEUE_MONITOR_INTERVAL if dify_config.QUEUE_MONITOR_INTERVAL else 30
),
},
# every 15 minutes
"check_upgradable_plugin_task": {
"task": "schedule.check_upgradable_plugin_task.check_upgradable_plugin_task",
"schedule": timedelta(minutes=15),
},
}
celery_app.conf.update(beat_schedule=beat_schedule, imports=imports)