mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-11-02 06:53:37 +00:00
feat(ops): 项目启动时,清除指定的celery定时任务;添加获取celery定时任务的函数 (#4378)
* feat(ops): 添加获取celery定时任务的函数 * feat(ops): 项目启动时,清除指定的celery定时任务 * feat(ops): 项目启动时,清除指定的celery定时任务 2 Co-authored-by: Bai <bugatti_it@163.com>
This commit is contained in:
@@ -93,6 +93,12 @@ def delete_celery_periodic_task(task_name):
|
||||
PeriodicTasks.update_changed()
|
||||
|
||||
|
||||
def get_celery_periodic_task(task_name):
|
||||
from django_celery_beat.models import PeriodicTask
|
||||
task = PeriodicTask.objects.filter(name=task_name).first()
|
||||
return task
|
||||
|
||||
|
||||
def get_celery_task_log_path(task_id):
|
||||
task_id = str(task_id)
|
||||
rel_path = os.path.join(task_id[0], task_id[1], task_id + '.log')
|
||||
|
||||
Reference in New Issue
Block a user