Update the handler to close the connection if empty data.

main
KKlochko 1 year ago
parent 19b2a231b3
commit 03f633e5ab

@ -58,10 +58,16 @@ class ProducerClient:
message = input('message: ')
await self.send_notification(title, message)
if title == '' and message == '':
self.console.print(f"[yellow b][INFO][/] Finished.")
self.console.print("[green]bye[/]")
break
except asyncio.CancelledError:
pass
except KeyboardInterrupt:
print("\nbye")
await self.send_notification('', '')
sys.exit(0)
finally:
self.writer.close()

Loading…
Cancel
Save