|
|
@ -121,20 +121,21 @@ def start_services(): |
|
|
|
if action == 'start' and {'all', 'web'} & set(services): |
|
|
|
if action == 'start' and {'all', 'web'} & set(services): |
|
|
|
prepare() |
|
|
|
prepare() |
|
|
|
|
|
|
|
|
|
|
|
services_string = ' '.join(services) |
|
|
|
start_args = [] |
|
|
|
cmd = f'{args.action} {services_string}' |
|
|
|
|
|
|
|
if args.daemon: |
|
|
|
if args.daemon: |
|
|
|
cmd += ' --daemon' |
|
|
|
start_args.append('--daemon') |
|
|
|
if args.worker: |
|
|
|
if args.worker: |
|
|
|
cmd += f' --worker {args.worker}' |
|
|
|
start_args.extend(['--worker', str(args.worker)]) |
|
|
|
if args.force: |
|
|
|
if args.force: |
|
|
|
cmd += ' --force' |
|
|
|
start_args.append('--force') |
|
|
|
|
|
|
|
|
|
|
|
lines = cmd.split() |
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
management.call_command(*lines) |
|
|
|
management.call_command(action, *services, *start_args) |
|
|
|
|
|
|
|
except KeyboardInterrupt: |
|
|
|
|
|
|
|
logging.info('Cancel ...') |
|
|
|
|
|
|
|
time.sleep(2) |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
logging.error("Start service error {}: {}".format(lines[0], e)) |
|
|
|
logging.error("Start service error {}: {}".format(services, e)) |
|
|
|
time.sleep(2) |
|
|
|
time.sleep(2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|