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