job_client.py 文件源码

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

项目:ava-capture 作者: electronicarts 项目源码 文件源码
def loop_forever(self):
        try:
            while 1:
                try:
                    self.status_changed = False
                    self.phone_home()

                except Exception as e:
                    self.logger.error('Failed to contact server. %s' % e)

                if self.need_restart and not self.container.running_jobs and not self.container.finished_jobs:
                    print 'Restarting...'
                    # End current process and launch a new one with the same command line parameters
                    #os.execvp('python.exe', ['python.exe'] + sys.argv)
                    exit(3)

                if not self.status_changed:
                    self.cpu_percent = psutil.cpu_percent(interval=self.PHONEHOME_DELAY)

        except KeyboardInterrupt:
            pass
        finally:
            print 'Exiting...'
            self.notify_exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号