Try to get missing status
This commit is contained in:
parent
07d17ede5f
commit
8ee75c5c72
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue