diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index e848645d1b..eecf23d437 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -392,10 +392,10 @@ public class IobCobCalculatorPlugin extends PluginBase { time = roundUpTime(previous); AutosensData data = autosensDataTable.get(time); if (data != null) { - //log.debug(">>> getAutosensData Cache hit " + data.log(time)); + //log.debug(">>> AUTOSENSDATA Cache hit " + data.toString()); return data; } else { -// log.debug(">>> getAutosensData Cache miss " + new Date(time).toLocaleString()); + //log.debug(">>> AUTOSENSDATA Cache miss " + new Date(time).toLocaleString()); return null; } } @@ -403,13 +403,13 @@ public class IobCobCalculatorPlugin extends PluginBase { @Nullable public AutosensData getLastAutosensDataSynchronized(String reason) { - if (thread != null && thread.getState() != Thread.State.TERMINATED) { - log.debug("getLastAutosensDataSynchronized is waiting for calculation thread: " + reason); + if (thread != null && thread.isAlive()) { + log.debug("AUTOSENSDATA is waiting for calculation thread: " + reason); try { thread.join(5000); } catch (InterruptedException ignored) { } - log.debug("getLastAutosensDataSynchronized finished waiting for calculation thread: " + reason); + log.debug("AUTOSENSDATA finished waiting for calculation thread: " + reason); } synchronized (dataLock) { return getLastAutosensData(reason); @@ -464,6 +464,7 @@ public class IobCobCalculatorPlugin extends PluginBase { log.debug("AUTOSENSDATA null: data is old (" + reason + ") size()=" + autosensDataTable.size() + " lastdata=" + DateUtil.dateAndTimeString(data.time)); return null; } else { + log.debug("AUTOSENSDATA (" + reason + ") " + data.toString()); return data; } }