From 648dcfa28e388cfd75e0f7e6363cb3d0b79c6c3b Mon Sep 17 00:00:00 2001 From: Johan Degraeve Date: Mon, 25 Apr 2022 21:47:40 +0200 Subject: [PATCH] trigger treatments sync every 5 minutes in follower mode by setting UserDefaults.standard.nightScoutSyncTreatmentsRequired = true a treatments sync is triggered This is now done when initiating download of readings. Download of new readings and sync of treatments is done simultaneously --- xdrip/Managers/NightScout/NightScoutFollowManager.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xdrip/Managers/NightScout/NightScoutFollowManager.swift b/xdrip/Managers/NightScout/NightScoutFollowManager.swift index e6670735..9ee7cc9e 100644 --- a/xdrip/Managers/NightScout/NightScoutFollowManager.swift +++ b/xdrip/Managers/NightScout/NightScoutFollowManager.swift @@ -145,6 +145,9 @@ class NightScoutFollowManager:NSObject { trace("in download", log: self.log, category: ConstantsLog.categoryNightScoutFollowManager, type: .info) + trace(" setting nightScoutSyncTreatmentsRequired to true, this will also initiate a treatments sync", log: self.log, category: ConstantsLog.categoryNightScoutFollowManager, type: .info) + UserDefaults.standard.nightScoutSyncTreatmentsRequired = true + // nightscout URl must be non-nil - could be that url is not valid, this is not checked here, the app will just retry every x minutes guard let nightScoutUrl = UserDefaults.standard.nightScoutUrl else {return}