Remove reindex in foreground for now

This commit is contained in:
Ali 2023-01-08 01:07:49 +04:00
parent 891c0fde97
commit bd974e8521

View File

@ -1335,16 +1335,17 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
}) })
} }
let timestamp = Int(CFAbsoluteTimeGetCurrent()) /*let timestamp = Int(CFAbsoluteTimeGetCurrent())
let minReindexTimestamp = timestamp - 2 * 24 * 60 * 60 let minReindexTimestamp = timestamp - 2 * 24 * 60 * 60
if let indexTimestamp = UserDefaults.standard.object(forKey: "TelegramCacheIndexTimestamp") as? NSNumber, indexTimestamp.intValue >= minReindexTimestamp { if let indexTimestamp = UserDefaults.standard.object(forKey: "TelegramCacheIndexTimestamp") as? NSNumber, indexTimestamp.intValue >= minReindexTimestamp {
} else { } else {
UserDefaults.standard.set(timestamp as NSNumber, forKey: "TelegramCacheIndexTimestamp")
Logger.shared.log("App \(self.episodeId)", "Executing low-impact cache reindex in foreground") Logger.shared.log("App \(self.episodeId)", "Executing low-impact cache reindex in foreground")
let _ = self.runCacheReindexTasks(lowImpact: true, completion: { let _ = self.runCacheReindexTasks(lowImpact: true, completion: {
Logger.shared.log("App \(self.episodeId)", "Executing low-impact cache reindex in foreground — done") Logger.shared.log("App \(self.episodeId)", "Executing low-impact cache reindex in foreground — done")
UserDefaults.standard.set(timestamp as NSNumber, forKey: "TelegramCacheIndexTimestamp")
}) })
} }*/
return true return true
} }