handlers.py 文件源码

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

项目:nbrsessionproxy 作者: jupyterhub 项目源码 文件源码
def is_running(self):
        '''Check if our proxied process is still running.'''

        if 'proc' not in self.state:
            return False

        # Check if the process is still around
        proc = self.state['proc']
        if proc.proc.poll() == 0:
            self.log.info('Cannot poll on process.')
            return False

        client = httpclient.AsyncHTTPClient()
        req = httpclient.HTTPRequest('http://localhost:{}'.format(self.port))

        try:
            yield client.fetch(req)
            self.log.debug('Got positive response from rstudio server')
        except:
            self.log.debug('Got negative response from rstudio server')
            return False

        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号