MCPcopy
hub / github.com/1Panel-dev/MaxKB / start_services

Function start_services

main.py:65–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64
65def start_services():
66 services = args.services if isinstance(args.services, list) else [args.services]
67 start_args = []
68 if args.daemon:
69 start_args.append('--daemon')
70 if args.force:
71 start_args.append('--force')
72 if args.worker:
73 start_args.extend(['--worker', str(args.worker)])
74 else:
75 worker = os.environ.get('MAXKB_CORE_WORKER')
76 if isinstance(worker, str) and worker.isdigit():
77 start_args.extend(['--worker', worker])
78
79 try:
80 management.call_command(action, *services, *start_args)
81 except KeyboardInterrupt:
82 logging.info('Cancel ...')
83 time.sleep(2)
84 except Exception as exc:
85 logging.error("Start service error {}: {}".format(services, exc))
86 time.sleep(2)
87
88
89def dev():

Callers 1

main.pyFile · 0.85

Calls 3

appendMethod · 0.45
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected