Print daemon status. This verifies that it is responsive to requests.
(args: argparse.Namespace)
| 417 | |
| 418 | @action(status_parser) |
| 419 | def do_status(args: argparse.Namespace) -> None: |
| 420 | """Print daemon status. |
| 421 | |
| 422 | This verifies that it is responsive to requests. |
| 423 | """ |
| 424 | status = read_status(args.status_file) |
| 425 | if args.verbose: |
| 426 | show_stats(status) |
| 427 | # Both check_status() and request() may raise BadStatus, |
| 428 | # which will be handled by main(). |
| 429 | check_status(status) |
| 430 | response = request( |
| 431 | args.status_file, "status", fswatcher_dump_file=args.fswatcher_dump_file, timeout=5 |
| 432 | ) |
| 433 | if args.verbose or "error" in response: |
| 434 | show_stats(response) |
| 435 | if "error" in response: |
| 436 | fail(f"Daemon may be busy processing; if this persists, consider {sys.argv[0]} kill") |
| 437 | print("Daemon is up and running") |
| 438 | |
| 439 | |
| 440 | @action(stop_parser) |
nothing calls this directly
no test coverage detected
searching dependent graphs…