Implement clean shutdown on KeyboardInterrupt
MODIFY
plex_trakt_sync/commands/webhook.py
plex_trakt_sync/commands/webhook.py
@@ -21,4 +21,9 @@ def webhook(bind: str, port: int):
with socketserver.TCPServer((bind, port), HttpRequestHandler) as httpd:
click.echo(f"Serving at http://{bind}:{port}")
+ try:
httpd.serve_forever()
+ except KeyboardInterrupt:
+ pass
+ httpd.server_close()
+ click.echo("Stopping httpd...")

Implement clean shutdown on KeyboardInterrupt