Files
life-echo/api/app/tasks/evaluation_tasks.py

21 lines
583 B
Python

"""评测实验 Celery 任务。"""
from __future__ import annotations
import asyncio
from celery import shared_task
from app.core.logging import get_logger
logger = get_logger(__name__)
@shared_task(name="evaluation.run_experiment")
def run_eval_experiment_task(experiment_id: str) -> None:
from app.features.evaluation.execution_service import execute_experiment_full
logger.info("evaluation task start experiment_id={}", experiment_id)
asyncio.run(execute_experiment_full(experiment_id))
logger.info("evaluation task done experiment_id={}", experiment_id)