Skip to content

Commit c01338b

Browse files
committed
Add chia start -f option.
1 parent 30f7693 commit c01338b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/cmds/start.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ def make_parser(parser):
2020
"-r",
2121
"--restart",
2222
action="store_true",
23-
help="Force restart of running processes",
23+
help="Restart of running processes",
24+
)
25+
parser.add_argument(
26+
"-f",
27+
"--force",
28+
action="store_true",
29+
help="Restart even if process seems to be running and it can't be stopped",
2430
)
2531
parser.set_defaults(function=start)
2632

@@ -30,10 +36,10 @@ def start(args, parser):
3036
processes: List = []
3137
for service in services_for_groups(args.group):
3238
if pid_path_for_service(args.root_path, service).is_file():
33-
if args.restart:
39+
if args.restart or args.force:
3440
print("restarting")
3541
stop_service(args.root_path, service)
36-
while pid_path_for_service(args.root_path, service).is_file():
42+
while pid_path_for_service(args.root_path, service).is_file() and not args.force:
3743
# try to avoid race condition
3844
# this is pretty hacky
3945
time.sleep(1)

0 commit comments

Comments
 (0)