diff --git a/ios/App/Podfile.lock b/ios/App/Podfile.lock index fdd46c56..a7171c3e 100644 --- a/ios/App/Podfile.lock +++ b/ios/App/Podfile.lock @@ -21,7 +21,7 @@ PODS: - Capacitor - CapacitorPreferences (7.0.1): - Capacitor - - CapacitorStatusBar (7.0.1): + - CapacitorStatusBar (7.0.6): - Capacitor - CordovaPlugins (6.2.1): - CapacitorCordova @@ -100,7 +100,7 @@ SPEC CHECKSUMS: CapacitorHaptics: 1f1e17041f435d8ead9ff2a34edd592c6aa6a8d6 CapacitorNetwork: 15cb4385f0913a8ceb5e9a4d7af1ec554bdb8de8 CapacitorPreferences: 6c98117d4d7508034a4af9db64d6b26fc75d7b94 - CapacitorStatusBar: 6e7af040d8fc4dd655999819625cae9c2d74c36f + CapacitorStatusBar: 416e9e53fd6397e668d4a181cd2131617d949bd6 CordovaPlugins: 2ecbba09775516c41764dbf78ade612427311b7e Realm: b1b3bc68162fa242132eb7eefbf91d7c40f36a85 RealmSwift: 456cfd82a4f23dff8e3456980999331ab69bbf3e diff --git a/ios/App/Shared/util/Database.swift b/ios/App/Shared/util/Database.swift index ee29c781..c4a35998 100644 --- a/ios/App/Shared/util/Database.swift +++ b/ios/App/Shared/util/Database.swift @@ -312,13 +312,13 @@ class Database { private func cleanExpiredLogs() throws { let realm = try Realm() let numberOfHoursToKeep = 48 - let keepLogCutoff = Date().addingTimeInterval(TimeInterval(-1 * numberOfHoursToKeep * 3600)) - + let keepLogCutoffMs = Int(Date().addingTimeInterval(TimeInterval(-1 * numberOfHoursToKeep * 3600)).timeIntervalSince1970 * 1000) + let allLogs = getAllLogs() var logsRemoved = 0 try? realm.write { allLogs.forEach { log in - if log.timestamp < Int(keepLogCutoff.timeIntervalSince1970) { + if log.timestamp < keepLogCutoffMs { realm.delete(log) logsRemoved += 1 }