Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #67: solved a bug where reconnect time would be waited even for succesful connections #71

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ private void connect() {
relpConnection.relpConfig().relpTarget, relpConnection.relpConfig().relpPort,
e.getMessage()
);
}

try {
Thread.sleep(relpConnection.relpConfig().relpReconnectInterval);
}
catch (InterruptedException e) {
LOGGER.error("Reconnect timer interrupted, reconnecting now");
try {
Thread.sleep(relpConnection.relpConfig().relpReconnectInterval);
}
catch (InterruptedException exception) {
LOGGER.error("Reconnection timer interrupted, reconnecting now");
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/EndToEndTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class EndToEndTest {
void setUp() throws InterruptedException {
System.setProperty("payload.splitEnabled", "true");
System.setProperty("security.authRequired", "false");
System.setProperty("relp.reconnectInterval", "1000");
System.setProperty("relp.port", "1601");

// Start listening to HTTP-requests
Expand All @@ -68,7 +67,6 @@ void reset() {
void tearDown() {
System.clearProperty("payload.splitEnabled");
System.clearProperty("security.authRequired");
System.clearProperty("relp.reconnectInterval");
System.clearProperty("relp.port");
this.relpServer.tearDown();
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/RebindTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ void setUp() {
void setProperties() {
System.setProperty("relp.rebindEnabled", "true");
System.setProperty("relp.rebindRequestAmount", "5");
System.setProperty("relp.reconnectInterval", "500");
}

@AfterEach
Expand All @@ -59,7 +58,6 @@ void reset() {
void tearDown() {
System.clearProperty("relp.rebindEnabled");
System.clearProperty("relp.rebindRequestAmount");
System.clearProperty("relp.reconnectInterval");
System.clearProperty("relp.port");
this.relpServer.tearDown();
}
Expand Down