Try to get missing status
This commit is contained in:
parent
07d17ede5f
commit
8ee75c5c72
1 changed files with 16 additions and 1 deletions
|
@ -34,7 +34,6 @@ public class Connector {
|
||||||
@Override
|
@Override
|
||||||
public void onStatusChange(Status status) {
|
public void onStatusChange(Status status) {
|
||||||
|
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
log("Status change: " + status);
|
log("Status change: " + status);
|
||||||
lastStatus = status;
|
lastStatus = status;
|
||||||
|
@ -175,11 +174,27 @@ public class Connector {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (lastStatus) {
|
switch (lastStatus) {
|
||||||
|
|
||||||
|
case CONNECTED:
|
||||||
|
if (lastStatusTime < 1) {
|
||||||
|
tryToGetStatusAgain();
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return lastStatus.toString();
|
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() {
|
public boolean lastStatusRecent() {
|
||||||
return true; // TODO evaluate whether current
|
return true; // TODO evaluate whether current
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue