You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
723B

  1. # -*- coding: utf-8 -*-
  2. from os.path import dirname, realpath
  3. from sys import argv
  4. from loguru import logger
  5. from torch import multiprocessing
  6. from service.Dispatcher import DispatcherService
  7. from util.LogUtils import init_log
  8. '''
  9. dsp主程序入口
  10. '''
  11. if __name__ == '__main__':
  12. multiprocessing.set_start_method('spawn')
  13. base_dir = dirname(realpath(__file__))
  14. init_log(base_dir)
  15. logger.info("(♥◠‿◠)ノ゙ DSP【算法调度服务】开始启动 ლ(´ڡ`ლ)゙")
  16. # 获取主程序执行根路径
  17. arg = argv
  18. logger.info("脚本启动参数: {}", arg)
  19. envs = ('dev', 'test', 'prod')
  20. active = [env for env in envs if env in arg]
  21. DispatcherService(base_dir, active)