Combo: retry twice to establish connection before giving up.
(cherry picked from commit a16560a)
This commit is contained in:
parent
26e7834093
commit
1f06d801a2
|
@ -824,6 +824,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
private CommandResult runOnConnectChecks() {
|
||||
// connect, get status and check if an alarm is active
|
||||
CommandResult preCheckResult = ruffyScripter.readPumpState();
|
||||
for (int retries = 2; !preCheckResult.success && retries > 0; retries--) {
|
||||
preCheckResult = ruffyScripter.readPumpState();
|
||||
}
|
||||
if (!preCheckResult.success) {
|
||||
return preCheckResult;
|
||||
}
|
||||
|
@ -1116,6 +1119,8 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
return null;
|
||||
}
|
||||
|
||||
// TODO still regularly continues even though no changes on pump exist ...
|
||||
|
||||
// OPTIMIZE this reads the entire history on start, so this could be optimized by persisting
|
||||
// `timestampOfLastKnownPumpBolusRecord`, though this should be thought through, to make sure
|
||||
// all scenarios are covered
|
||||
|
|
Loading…
Reference in a new issue