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)
评论列表
文章目录