Sfoglia il codice sorgente

PR feedback: lower number for doing batch inserts to 1 instead of 3

polscm32 1 anno fa
parent
commit
1b26753362
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      Trio/Sources/APS/Storage/GlucoseStorage.swift

+ 3 - 3
Trio/Sources/APS/Storage/GlucoseStorage.swift

@@ -103,10 +103,10 @@ final class BaseGlucoseStorage: GlucoseStorage, Injectable {
     }
 
     private func storeGlucoseInCoreData(_ glucose: [BloodGlucose]) throws {
-        if glucose.count <= 3 {
-            try storeGlucoseRegular(glucose)
-        } else {
+        if glucose.count > 1 {
             try storeGlucoseBatch(glucose)
+        } else {
+            try storeGlucoseRegular(glucose)
         }
     }