Retry Get pulse log command in case of failure
This commit is contained in:
parent
6d377d7b6a
commit
10ab880e28
1 changed files with 12 additions and 6 deletions
|
@ -90,13 +90,19 @@ public class OmnipodUITask {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GetPodPulseLog:
|
case GetPodPulseLog:
|
||||||
try {
|
// This command is very error prone, so retry a few times if it fails
|
||||||
returnDataObject = communicationManager.readPulseLog();
|
// Can take some time, but that's ok since this is a very specific feature for experts
|
||||||
} catch(Exception ex) {
|
// And will not be used by normal users
|
||||||
if(isLogEnabled()) {
|
for(int i = 0; 3 > i; i++) {
|
||||||
LOG.warn("Failed to retrieve pulse log", ex);
|
try {
|
||||||
|
returnDataObject = communicationManager.readPulseLog();
|
||||||
|
break;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
if (isLogEnabled()) {
|
||||||
|
LOG.warn("Failed to retrieve pulse log", ex);
|
||||||
|
}
|
||||||
|
returnDataObject = null;
|
||||||
}
|
}
|
||||||
returnDataObject = null;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue