Add the exit interrupt and the exit message.

main
KKlochko 1 year ago
parent ce9c7bb301
commit 5cf868659e

@ -18,6 +18,9 @@
###############################################################################
import asyncio
import sys
from rich.console import Console
import typer
from notification_server.server import Server
@ -44,5 +47,10 @@ def up(
This command [b]start[/] the [yellow b]server[/] which receives notifications and sends to the clients.
"""
server = Server(ip, port, producer_port)
asyncio.run(server.up())
try:
server = Server(ip, port, producer_port)
asyncio.run(server.up())
except KeyboardInterrupt:
console = Console()
console.print('[green b][INFO][/] bye[/]')
sys.exit(0)

Loading…
Cancel
Save