models.py 文件源码

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

项目:kobo 作者: release-engineering 项目源码 文件源码
def interrupt_task(self, recursive=True):
        """Set the task state to interrupted."""
        try:
            self.__lock(self.worker_id, new_state=TASK_STATES["INTERRUPTED"], initial_states=(TASK_STATES["OPEN"], ))
        except (MultipleObjectsReturned, ObjectDoesNotExist):
            raise Exception("Cannot interrupt task %d, state is %s" % (self.id, self.get_state_display()))

        if recursive:
            for task in self.subtasks():
                task.interrupt_task(recursive=True)
        self.logs.gzip_logs()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号