From c4b9b22ab93804be4001fdee7175a7dc453f8bd4 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 19 Feb 2023 20:47:15 +0100 Subject: [PATCH] NSCv3: improve scheduling --- .../nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 39cdb45e81..0196704a0a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -239,9 +239,9 @@ class NSClientV3Plugin @Inject constructor( if (it is ValueWrapper.Existing) { if (it.value.timestamp < dateUtil.now() - T.mins(5).plus(T.secs(20)).msecs()) { refreshInterval = T.mins(1).msecs() - executeLoop("MAIN_LOOP", forceNew = false) + executeLoop("MAIN_LOOP", forceNew = true) } - } else executeLoop("MAIN_LOOP", forceNew = false) + } else executeLoop("MAIN_LOOP", forceNew = true) } handler.postDelayed(runLoop, refreshInterval) rxBus.send(EventNSClientNewLog("● TICK", ""))