Retry Get pulse log command in case of failure

This commit is contained in:
Bart Sopers 2019-12-27 13:51:20 -05:00
parent 6d377d7b6a
commit 10ab880e28

View file

@ -90,14 +90,20 @@ public class OmnipodUITask {
break; break;
case GetPodPulseLog: case GetPodPulseLog:
// This command is very error prone, so retry a few times if it fails
// Can take some time, but that's ok since this is a very specific feature for experts
// And will not be used by normal users
for(int i = 0; 3 > i; i++) {
try { try {
returnDataObject = communicationManager.readPulseLog(); returnDataObject = communicationManager.readPulseLog();
} catch(Exception ex) { break;
if(isLogEnabled()) { } catch (Exception ex) {
if (isLogEnabled()) {
LOG.warn("Failed to retrieve pulse log", ex); LOG.warn("Failed to retrieve pulse log", ex);
} }
returnDataObject = null; returnDataObject = null;
} }
}
break; break;
case GetPodStatus: case GetPodStatus: