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
This commit is contained in:
Johan Degraeve 2022-04-25 21:47:40 +02:00
parent 43cb5fa019
commit 648dcfa28e
1 changed files with 3 additions and 0 deletions

View File

@ -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}