File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments