Browse Source

[CLI] `qmk docs` graceful shutdown on Ctrl+C (#6989)

pull/6921/head 0.7.38
fauxpark 4 years ago
committed by Drashna Jaelre
parent
commit
076d8babbb
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      lib/python/qmk/cli/docs.py

+ 6
- 1
lib/python/qmk/cli/docs.py View File

@ -19,4 +19,9 @@ def docs(cli):
cli.log.info("Serving QMK docs at http://localhost:%d/", cli.config.docs.port)
cli.log.info("Press Control+C to exit.")
httpd.serve_forever()
try:
httpd.serve_forever()
except KeyboardInterrupt:
cli.log.info("Stopping HTTP server...")
finally:
httpd.shutdown()

Loading…
Cancel
Save