workers.py 文件源码

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

项目:osp-scraper 作者: opensyllabus 项目源码 文件源码
def request_stop(self, *args, **kwargs):
        """When SIGINT is sent to the worker (eg, if the Supervisor process
        group is restarted), immediately fail the running job and stop the
        worker. This avoids a scenario in which the worker gets shut down but
        not unregistered in Redis, causing it to get "marooned" in the admin.
        """
        job = self.get_current_job()

        if job:
            self.handle_job_failure(job)
            self.failed_queue.quarantine(job, 'Worker shutdown.')

        self.request_force_stop(*args, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号