Temporarily disable account cleanup

This commit is contained in:
Ali
2021-03-31 02:50:58 +04:00
parent de164d0df8
commit 74b08e1056
3 changed files with 13 additions and 21 deletions

View File

@@ -1412,17 +1412,6 @@ public final class Postbox {
self.mediaBox = MediaBox(basePath: self.basePath + "/media")
self.valueBox = valueBox
/*self.pipeNotifier = PipeNotifier(basePath: basePath, notify: { [weak self] in
//if let strongSelf = self {
/*strongSelf.queue.async {
if strongSelf.valueBox != nil {
let _ = strongSelf.transaction({ _ -> Void in
}).start()
}
}*/
//}
})*/
self.metadataTable = MetadataTable(valueBox: self.valueBox, table: MetadataTable.tableSpec(0))
self.keychainTable = KeychainTable(valueBox: self.valueBox, table: KeychainTable.tableSpec(1))

View File

@@ -1124,14 +1124,16 @@ public class Account {
}
self.managedOperationsDisposable.add(managedGreetingStickers(postbox: self.postbox, network: self.network).start())
let mediaBox = postbox.mediaBox
self.storageSettingsDisposable = accountManager.sharedData(keys: [SharedDataKeys.cacheStorageSettings]).start(next: { [weak mediaBox] sharedData in
guard let mediaBox = mediaBox else {
return
}
let settings: CacheStorageSettings = sharedData.entries[SharedDataKeys.cacheStorageSettings] as? CacheStorageSettings ?? CacheStorageSettings.defaultSettings
mediaBox.setMaxStoreTimes(general: settings.defaultCacheStorageTimeout, shortLived: 60 * 60, gigabytesLimit: settings.defaultCacheStorageLimitGigabytes)
})
if !supplementary {
let mediaBox = postbox.mediaBox
self.storageSettingsDisposable = accountManager.sharedData(keys: [SharedDataKeys.cacheStorageSettings]).start(next: { [weak mediaBox] sharedData in
guard let mediaBox = mediaBox else {
return
}
let settings: CacheStorageSettings = sharedData.entries[SharedDataKeys.cacheStorageSettings] as? CacheStorageSettings ?? CacheStorageSettings.defaultSettings
mediaBox.setMaxStoreTimes(general: settings.defaultCacheStorageTimeout, shortLived: 60 * 60, gigabytesLimit: settings.defaultCacheStorageLimitGigabytes)
})
}
let _ = masterNotificationsKey(masterNotificationKeyValue: self.masterNotificationKey, postbox: self.postbox, ignoreDisabled: false).start(next: { key in
let encoder = JSONEncoder()

View File

@@ -373,7 +373,8 @@ public func managedCleanupAccounts(networkArguments: NetworkInitializationArgume
}
for (id, attributes, disposable) in beginList {
Logger.shared.log("managedCleanupAccounts", "cleanup \(id), current is \(String(describing: view.currentRecord?.id))")
disposable.set(cleanupAccount(networkArguments: networkArguments, accountManager: accountManager, id: id, encryptionParameters: encryptionParameters, attributes: attributes, rootPath: rootPath, auxiliaryMethods: auxiliaryMethods).start())
//TODO:localize
//disposable.set(cleanupAccount(networkArguments: networkArguments, accountManager: accountManager, id: id, encryptionParameters: encryptionParameters, attributes: attributes, rootPath: rootPath, auxiliaryMethods: auxiliaryMethods).start())
}
var validPaths = Set<String>()