fix retry
This commit is contained in:
parent
5664805903
commit
84867247bc
1 changed files with 8 additions and 7 deletions
|
@ -681,13 +681,14 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
if (bolusCanceled && podStateManager.activeCommand != null) {
|
if (bolusCanceled && podStateManager.activeCommand != null) {
|
||||||
var errorGettingStatus: Throwable? = null
|
var errorGettingStatus: Throwable? = null
|
||||||
for (tries in 1..BOLUS_RETRIES) {
|
for (tries in 1..BOLUS_RETRIES) {
|
||||||
getPodStatus()
|
try {
|
||||||
.doOnError {
|
getPodStatus().blockingAwait()
|
||||||
errorGettingStatus = it
|
break
|
||||||
|
} catch (err: Throwable) {
|
||||||
|
errorGettingStatus = err
|
||||||
aapsLogger.debug(LTag.PUMP, "waitForBolusDeliveryToComplete errorGettingStatus=$errorGettingStatus")
|
aapsLogger.debug(LTag.PUMP, "waitForBolusDeliveryToComplete errorGettingStatus=$errorGettingStatus")
|
||||||
Thread.sleep(BOLUS_RETRY_INTERVAL_MS) // retry every 2 sec
|
Thread.sleep(BOLUS_RETRY_INTERVAL_MS) // retry every 2 sec
|
||||||
}
|
}
|
||||||
.blockingSubscribe()
|
|
||||||
}
|
}
|
||||||
if (errorGettingStatus != null) {
|
if (errorGettingStatus != null) {
|
||||||
// requestedBolusAmount will be updated later, via pumpSync
|
// requestedBolusAmount will be updated later, via pumpSync
|
||||||
|
|
Loading…
Reference in a new issue