Skip to content

Commit

Permalink
Merge pull request #20 from bringauto/BAF-891/slow_reconnect
Browse files Browse the repository at this point in the history
Restart server after last device disconnects
  • Loading branch information
MarioIvancik authored Jun 12, 2024
2 parents 940b2b3 + 1fb9f27 commit a6ed6d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions external_server/external_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ def _handle_status(self, received_status: external_protocol.Status) -> None:

status_response = self._create_status_response(status)
self._mqtt_client.publish(status_response)
if len(self._connected_devices) == 0:
self._logger.warning("All devices have been disconnected, restarting server")
raise CommunicationException()

def _handle_command_response(self, command_response: external_protocol.CommandResponse) -> None:
self._logger.info("Received command response")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[project]
name = "external_server"
version = "1.1.8 "
version = "1.1.9"

0 comments on commit a6ed6d8

Please sign in to comment.