定时任务

This commit is contained in:
lhx
2025-09-27 11:42:26 +08:00
parent 173935014e
commit 345ee50a7b
5 changed files with 54 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ from ..schemas.task import (
JobResponse, AddCronJobRequest, AddIntervalJobRequest,
AddDateJobRequest, TaskResponse
)
from ..utils.scheduler import task_scheduler, example_task, database_cleanup_task
from ..utils.scheduler import task_scheduler, example_task, database_cleanup_task, reset_today_updated_task
router = APIRouter(prefix="/tasks", tags=["定时任务管理"])
@@ -12,6 +12,7 @@ router = APIRouter(prefix="/tasks", tags=["定时任务管理"])
AVAILABLE_FUNCTIONS = {
"example_task": example_task,
"database_cleanup_task": database_cleanup_task,
"reset_today_updated_task": reset_today_updated_task,
}
@router.post("/cron", response_model=TaskResponse)