{% extends "base.html" %} {% block title %}AgomTradePro - {{ page_title }}{% endblock %} {% block content %}
把数据库中的 PeriodicTask 配置和 Celery 运行态放在一个视图里,便于确认默认计划任务是否已初始化、是否启用,以及最近有没有失败。
| 任务 | 调度 | 启用 | 最近运行 | 最近执行结果 | 失败(24h) |
|---|---|---|---|---|---|
|
{{ task.name }}
{{ task.task_path }}
{% if task.description %}
{{ task.description }}
{% endif %}
kwargs: {{ task.kwargs_preview }}
|
{{ task.schedule_display }}
{{ task.schedule_type }}{% if task.queue %} | queue={{ task.queue }}{% endif %}
|
{% if task.enabled %}
enabled
{% else %}
disabled
{% endif %}
run count: {{ task.total_run_count }}
|
{% if task.last_run_at %}
{{ task.last_run_at|date:"Y-m-d H:i" }}
{% else %}
尚未运行
{% endif %}
|
{% if task.last_execution_status == "success" %}
success
{% elif task.last_execution_status == "failure" or task.last_execution_status == "timeout" %}
{{ task.last_execution_status }}
{% elif task.last_execution_status %}
{{ task.last_execution_status }}
{% else %}
no record
{% endif %}
{% if task.last_execution_at %}
{{ task.last_execution_at|date:"Y-m-d H:i" }}
{% endif %}
{% if task.last_runtime_seconds %}
runtime {{ task.last_runtime_seconds|floatformat:2 }}s
{% endif %}
|
{% if task.recent_failure_count > 0 %} {{ task.recent_failure_count }} {% else %} 0 {% endif %} |
| 当前数据库中还没有 PeriodicTask。可以先点击上方的一键初始化。 | |||||
周期任务本身存放在 django_celery_beat 的数据库表里,页面这里只做统一观测与初始化入口;细粒度编辑仍可直接走 Django Admin。