Fix code for logging reset

sync2
Laurent 11 months ago
parent fb9d60ffd2
commit a03ee52c70
  1. 7
      LeStorage/StoreCenter.swift
  2. 6
      LeStorage/StoredCollection.swift

@ -252,10 +252,13 @@ public class StoreCenter {
}
public func resetLoggingCollections() {
self._failedAPICallsCollection?.reset()
self._logs?.reset()
Task {
do {
try FileManager.default.removeItem(at: Log.urlForJSONFile())
try FileManager.default.removeItem(at: FailedAPICall.urlForJSONFile())
let facApiCallCollection: ApiCallCollection<FailedAPICall> = try self.apiCallCollection()
await facApiCallCollection.reset()
let logApiCallCollection: ApiCallCollection<Log> = try self.apiCallCollection()

@ -124,7 +124,11 @@ public class StoredCollection<T: Storable>: RandomAccessCollection, SomeCollecti
if self.asynchronousIO {
Task(priority: .high) {
try self._decodeJSONFile()
do {
try self._decodeJSONFile()
} catch {
Logger.error(error)
}
}
} else {
try self._decodeJSONFile()

Loading…
Cancel
Save