Debugging

This commit is contained in:
Isaac 2024-10-15 23:14:11 +04:00
parent c419459b33
commit 19879cc4a7
3 changed files with 4 additions and 8 deletions

View File

@ -17,9 +17,9 @@ import AccountContext
private func fileSize(_ path: String, useTotalFileAllocatedSize: Bool = false) -> Int64? {
if useTotalFileAllocatedSize {
let url = URL(fileURLWithPath: path)
if let values = (try? url.resourceValues(forKeys: Set([.isRegularFileKey, .totalFileAllocatedSizeKey]))) {
if let values = (try? url.resourceValues(forKeys: Set([.isRegularFileKey, .fileAllocatedSizeKey]))) {
if values.isRegularFile ?? false {
if let fileSize = values.totalFileAllocatedSize {
if let fileSize = values.fileAllocatedSize {
return Int64(fileSize)
}
}

View File

@ -17,9 +17,9 @@ private func alignUp(size: Int, align: Int) -> Int {
private func fileSize(_ path: String, useTotalFileAllocatedSize: Bool = false) -> Int64? {
if useTotalFileAllocatedSize {
let url = URL(fileURLWithPath: path)
if let values = (try? url.resourceValues(forKeys: Set([.isRegularFileKey, .totalFileAllocatedSizeKey]))) {
if let values = (try? url.resourceValues(forKeys: Set([.isRegularFileKey, .fileAllocatedSizeKey]))) {
if values.isRegularFile ?? false {
if let fileSize = values.totalFileAllocatedSize {
if let fileSize = values.fileAllocatedSize {
return Int64(fileSize)
}
}

View File

@ -1722,10 +1722,6 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
}
private func runCacheReindexTasks(lowImpact: Bool, completion: @escaping () -> Void) -> Disposable {
if "".isEmpty {
return EmptyDisposable
}
let disposable = MetaDisposable()
let _ = (self.sharedContextPromise.get()