Try to get missing status

This commit is contained in:
Jamorham 2018-01-25 23:20:14 +00:00
parent 07d17ede5f
commit 8ee75c5c72
No known key found for this signature in database
GPG key ID: 0BC5C3E0AAD64DF9

View file

@ -34,7 +34,6 @@ public class Connector {
@Override
public void onStatusChange(Status status) {
synchronized (this) {
log("Status change: " + status);
lastStatus = status;
@ -175,11 +174,27 @@ public class Connector {
}
switch (lastStatus) {
case CONNECTED:
if (lastStatusTime < 1) {
tryToGetStatusAgain();
}
default:
return lastStatus.toString();
}
}
private void tryToGetStatusAgain() {
if (Helpers.ratelimit("insight-retry-status-request", 5)) {
try {
MainApp.getConfigBuilder().getCommandQueue().readStatus("Insight. Status missing", null);
} catch (NullPointerException e) {
//
}
}
}
public boolean lastStatusRecent() {
return true; // TODO evaluate whether current
}