celery_init.py 文件源码

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

项目:jtyd_python_spider 作者: xtuyaowu 项目源码 文件源码
def task_failure_handler(sender=None, headers=None, body=None, **kwargs):
    # information about task are located in headers for task messages
    # using the task protocol version 2.
    mongoengine.connect(**celery_config.mongoengine_SETTINGS)
    task_id = sender.request.get('id')
    task_monitor_ob = task_monitor.objects(task_id= task_id).first()
    task_monitor_ob.celery_stask_status = 6
    task_monitor_ob.update_time = datetime.now(tz = pytz.timezone('Asia/Shanghai'))
    task_monitor_ob.save()

# ?????
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号