worker.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:kmeans-service 作者: MAYHEM-Lab 项目源码 文件源码
def rerun_task(job_id, task_id):
    """
    Reruns a specific task from a job. Sets the task status to 'pending' and triggers an asynchronous function to
    process the task.

    Parameters
    ----------
    job_id: str
    task_id: int

    Returns
    -------
    None
    """
    job = mongo_no_context_get_job(job_id)
    task = mongo_no_context_get_task(job_id, task_id)
    k = task['k']
    covar_type = task['covar_type']
    covar_tied = task['covar_tied']
    n_init = task['n_init']
    s3_file_key = job['s3_file_key']
    columns = job['columns']
    scale = job.get('scale', False)
    response = mongo_no_context_update_task_status(job_id, task_id, 'pending')
    work_task.delay(job_id, task_id, k, covar_type, covar_tied, n_init, s3_file_key, columns, scale)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号