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.

27 satır
747B

  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. arg = argv
  15. print("脚本启动参数: ", arg)
  16. envs = ('dev', 'test', 'prod')
  17. env = envs[0]
  18. active = [env for env in envs if env in arg]
  19. if len(active) != 0:
  20. env = active[0]
  21. init_log(base_dir, env)
  22. logger.info("(♥◠‿◠)ノ゙ DSP【算法调度服务】开始启动 ლ(´ڡ`ლ)゙")
  23. DispatcherService(base_dir, env)