mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Move removed account cleanup to background
This commit is contained in:
parent
b91b00b068
commit
49b656b125
@ -390,11 +390,13 @@ public func managedCleanupAccounts(networkArguments: NetworkInitializationArgume
|
|||||||
validPaths.insert("\(accountRecordIdPathName(record.id))")
|
validPaths.insert("\(accountRecordIdPathName(record.id))")
|
||||||
}
|
}
|
||||||
|
|
||||||
if let files = try? FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: rootPath), includingPropertiesForKeys: [], options: []) {
|
DispatchQueue.global(qos: .utility).async {
|
||||||
for url in files {
|
if let files = try? FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: rootPath), includingPropertiesForKeys: [], options: []) {
|
||||||
if url.lastPathComponent.hasPrefix("account-") {
|
for url in files {
|
||||||
if !validPaths.contains(url.lastPathComponent) {
|
if url.lastPathComponent.hasPrefix("account-") {
|
||||||
try? FileManager.default.removeItem(at: url)
|
if !validPaths.contains(url.lastPathComponent) {
|
||||||
|
try? FileManager.default.removeItem(at: url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user