Don't declare connection unusable too quickly.
This commit is contained in:
parent
181338e9e2
commit
ea1fd8fee8
1 changed files with 5 additions and 3 deletions
|
@ -187,10 +187,10 @@ public class RuffyScripter implements RuffyCommands {
|
||||||
if (!ruffyService.isConnected()) {
|
if (!ruffyService.isConnected()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (System.currentTimeMillis() - menuLastUpdated >= 500) {
|
if (System.currentTimeMillis() - menuLastUpdated >= 1500) {
|
||||||
waitForScreenUpdate();
|
waitForScreenUpdate();
|
||||||
}
|
}
|
||||||
return System.currentTimeMillis() - menuLastUpdated < 500;
|
return System.currentTimeMillis() - menuLastUpdated < 1500;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,9 @@ public class RuffyScripter implements RuffyCommands {
|
||||||
// on connection loss try to reconnect, confirm warning alerts caused by
|
// on connection loss try to reconnect, confirm warning alerts caused by
|
||||||
// the disconnected and then return the command as failed (the caller
|
// the disconnected and then return the command as failed (the caller
|
||||||
// can retry if needed).
|
// can retry if needed).
|
||||||
log.debug("Connection unusable, aborting command and attempting reconnect ...");
|
log.debug("Connection unusable (ruffy connection: " + ruffyService.isConnected() + ", "
|
||||||
|
+ "time since last menu update: " + (System.currentTimeMillis() - menuLastUpdated) + " ms, "
|
||||||
|
+ "aborting command and attempting reconnect ...");
|
||||||
cmdThread.interrupt();
|
cmdThread.interrupt();
|
||||||
activeCmd.getResult().success = false;
|
activeCmd.getResult().success = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue