File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -212,9 +212,7 @@ def do_run(args: argparse.Namespace) -> None:
212
212
since we don't want to duplicate mypy's huge list of flags.
213
213
(The -- is only necessary if flags are specified.)
214
214
"""
215
- try :
216
- get_status ()
217
- except BadStatus as err :
215
+ if not is_running ():
218
216
# Bad or missing status file or dead process; good to start.
219
217
start_server (args , allow_sources = True )
220
218
@@ -441,6 +439,15 @@ def read_status() -> Dict[str, object]:
441
439
return data
442
440
443
441
442
+ def is_running () -> bool :
443
+ """Check if the server is running cleanly"""
444
+ try :
445
+ get_status ()
446
+ except BadStatus as err :
447
+ return False
448
+ return True
449
+
450
+
444
451
# Run main().
445
452
446
453
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments