Fix server shut down on exit.

If there's a websocket being waited on the shut down won't actually
happen. Add a new event for shut down and send it to break the websocket
out of its loop.
This commit is contained in:
Dan Albert
2022-02-25 17:12:00 -08:00
parent 2efe4f6c80
commit af4a718fc7
3 changed files with 12 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ class GameUpdateEvents:
deleted_flights: set[UUID] = field(default_factory=set)
selected_flight: UUID | None = None
deselected_flight: bool = False
shutting_down: bool = False
@property
def empty(self) -> bool:
@@ -89,3 +90,7 @@ class GameUpdateEvents:
self.deselected_flight = True
self.selected_flight = None
return self
def shut_down(self) -> GameUpdateEvents:
self.shutting_down = True
return self