Skip to content

Commit

Permalink
Remove RemoteCounter to try forever
Browse files Browse the repository at this point in the history
  • Loading branch information
xprojects-de committed Oct 23, 2020
1 parent a31404d commit 7e47046
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>x</groupId>
<artifactId>Alpdesk-Automationservice</artifactId>
<version>2.2.3</version>
<version>2.2.4</version>

<packaging>jar</packaging>

Expand Down
16 changes: 3 additions & 13 deletions src/main/java/x/Devices/RemoteDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class RemoteDevice extends BaseDevice {
private final Logger logger = LoggerFactory.getLogger(RemoteDevice.class);
RemoteAccessRequest request = null;
public boolean activ = false;
private int retryCounter = 0;

public RemoteDevice(boolean activ, String url, int cycleTime, String jwt) {
super(cycleTime);
Expand All @@ -23,22 +22,13 @@ public void receiveIdle() {
try {
boolean response = request.execute();
if (response == false) {
retryCounter++;
if (retryCounter >= 100) {
activ = false;
logger.info("Deaktivating RemoteAccess in response!");
}
logger.error("Error sending RemoteRequest");
} else {
retryCounter = 0;
logger.debug("REMOTE " + response);
}
} catch (Exception ex) {
retryCounter++;
if (retryCounter >= 100) {
activ = false;
logger.info("Deaktivating RemoteAccess in Exception!");
logger.error(ex.getMessage());
}
logger.error("Error sending RemoteRequest");
logger.error(ex.getMessage());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/x/main/XHomeautomationMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class XHomeautomationMain implements ApplicationRunner {

Logger logger = LoggerFactory.getLogger(XHomeautomationMain.class);

public static final String VERSION = "2.2.3";
public static final String VERSION = "2.2.4";

@Autowired
RetainProcess retainProcess;
Expand Down

0 comments on commit 7e47046

Please sign in to comment.