jobs.py 文件源码

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

项目:jobs 作者: josiahcarlson 项目源码 文件源码
def stop(self, failed=False, shutting_down=False):
        '''
        Stops a job if running. If the optional "failed" argument is true,
        outputs will not be set as available.
        '''
        if self.is_running:
            with self._lock:
                if not self.is_running:
                    # another thread could have changed the status
                    return
                failed = bool(failed)
                DEFAULT_LOGGER.info("Stopping job failed = %r", bool(failed))
                if shutting_down:
                    DEFAULT_LOGGER.warning("Stopping job as part of atexit/signal handler exit")
                try:
                    _finish_job(self.conn, self.inputs, self.outputs, self.identifier,
                        failed=failed)
                finally:
                    self.last_refreshed = None
                    self.auto_refresh = None
                    LOCKED.discard(self)
                    AUTO_REFRESH.discard(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号