Try to rework the ugly fix
This commit is contained in:
parent
c78117e356
commit
afaf729df1
|
@ -376,12 +376,6 @@ public class IobCobCalculatorPlugin extends PluginBase {
|
|||
|
||||
@Nullable
|
||||
public AutosensData getAutosensData(long time) {
|
||||
return this.getAutosensData(time, true);
|
||||
}
|
||||
|
||||
// just a dirty workaround to avoid problems using a too fresh time
|
||||
// should get reworked...
|
||||
private AutosensData getAutosensData(long time, boolean firstCall) {
|
||||
synchronized (dataLock) {
|
||||
long now = System.currentTimeMillis();
|
||||
if (time > now) {
|
||||
|
@ -398,9 +392,6 @@ public class IobCobCalculatorPlugin extends PluginBase {
|
|||
return data;
|
||||
} else {
|
||||
// log.debug(">>> getAutosensData Cache miss " + new Date(time).toLocaleString());
|
||||
if (firstCall) {
|
||||
return this.getAutosensData(time - T.mins(5).msecs(), false);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,9 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
|
|||
return new AutosensResult();
|
||||
}
|
||||
|
||||
AutosensData current = IobCobCalculatorPlugin.getPlugin().getAutosensData(toTime); // this is running inside lock already
|
||||
// the current
|
||||
AutosensData current = IobCobCalculatorPlugin.getPlugin()
|
||||
.getLastAutosensDataSynchronized("SensitivityOref1Plugin"); // this is running inside lock already
|
||||
if (current == null) {
|
||||
log.debug("No current autosens data available");
|
||||
return new AutosensResult();
|
||||
|
|
Loading…
Reference in a new issue