mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Move removed account cleanup to background
This commit is contained in:
parent
b91b00b068
commit
49b656b125
1 changed files with 7 additions and 5 deletions
|
|
@ -390,11 +390,13 @@ public func managedCleanupAccounts(networkArguments: NetworkInitializationArgume
|
|||
validPaths.insert("\(accountRecordIdPathName(record.id))")
|
||||
}
|
||||
|
||||
if let files = try? FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: rootPath), includingPropertiesForKeys: [], options: []) {
|
||||
for url in files {
|
||||
if url.lastPathComponent.hasPrefix("account-") {
|
||||
if !validPaths.contains(url.lastPathComponent) {
|
||||
try? FileManager.default.removeItem(at: url)
|
||||
DispatchQueue.global(qos: .utility).async {
|
||||
if let files = try? FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: rootPath), includingPropertiesForKeys: [], options: []) {
|
||||
for url in files {
|
||||
if url.lastPathComponent.hasPrefix("account-") {
|
||||
if !validPaths.contains(url.lastPathComponent) {
|
||||
try? FileManager.default.removeItem(at: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue