management.py 文件源码

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

项目:PyPlanet 作者: PyPlanet 项目源码 文件源码
def execute(self):
        # Parse arguments.
        self.arguments = self.parser.parse_args()

        # Initiate the logger.
        threading.current_thread().setName('Main')
        initiate_logger()
        self.logger = logging.getLogger(__name__)

        # Initiate the settings by accessing one.
        self.logger.debug('Initiated configuration and environment... (debug on, means no error reporting and verbose output')
        if not settings.DEBUG:
            self.logger.info('Initiated configuration and environment...')
        self.logger.info('-------------------------------[  PyPlanet v{}  ]-------------------------------'.format(version))

        # Start god process (the current started process).
        pool = EnvironmentPool(settings.POOLS, max_restarts=self.arguments.max_restarts)
        pool.populate()

        # Starting all processes.
        pool.start()

        # Start the watchdog.
        try:
            pool.watchdog()
        except KeyboardInterrupt:
            pool.shutdown()
            exit(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号