Преглед изворни кода

Bug fix after bad merge. And revert test code.

Jon Mårtensson пре 3 година
родитељ
комит
5ae348de21

+ 0 - 11
FreeAPS/Sources/APS/APSManager.swift

@@ -1032,14 +1032,6 @@ final class BaseAPSManager: APSManager, Injectable {
         if nr_bgs > 0 {
             // Up to 91 days
             bg_total = bg / nr_bgs
-
-            // If less then 24 hours of glucose data, use total instead
-            if bg_1 == 0 {
-                bg_1 = bg_total
-                bgArray_1 = bgArrayForTIR
-                end1 = true
-                nr_bgs_1 = nr_bgs
-            }
         }
 
         // Total median
@@ -1194,9 +1186,6 @@ final class BaseAPSManager: APSManager, Injectable {
 
         let nrOfCGMReadings = nr1
 
-        let glucose24Hours = storage.retrieve(OpenAPS.Monitor.glucose, as: [BloodGlucose].self)
-        let nrOfCGMReadings = glucose24Hours?.count ?? 0
-
         let loopstat = LoopCycles(
             loops: successNR + errorNR,
             errors: errorNR,

+ 1 - 1
FreeAPS/Sources/Services/Storage/Disk/Disk+Codable.swift

@@ -66,7 +66,7 @@ public extension Disk {
                     try newData.write(to: url, options: .atomic)
                 }
             } else {
-                try? save([value], to: directory, as: path, encoder: encoder)
+                try save([value], to: directory, as: path, encoder: encoder)
             }
         } catch {
             throw error