Skip to content

Commit

Permalink
Task: connect() shall fail fast is backend is unresponsive
Browse files Browse the repository at this point in the history
  • Loading branch information
PBrunot committed Aug 16, 2024
1 parent 4a8ca30 commit 581ea6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ namespace fabomatic
Board::logic.changeStatus(Status::Connecting);

// Try to connect
server.connect();
if (!server.shouldFailFast())
{
server.connect();
}

// Refresh after connection
Board::logic.changeStatus(server.isOnline() ? Status::Connected : Status::Offline);

Expand Down
6 changes: 5 additions & 1 deletion test/test_mqtt/test_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ namespace fabomatic::tests
logic.changeStatus(BoardLogic::Status::Connecting);

// Try to connect
server.connect();
if (!server.shouldFailFast())
{
server.connect();
}

// Refresh after connection
logic.changeStatus(server.isOnline() ? BoardLogic::Status::Connected : BoardLogic::Status::Offline);
}
Expand Down

0 comments on commit 581ea6e

Please sign in to comment.