Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Wait for queued Ensu log writes before reading

Manav Rathie17af27f5b00
diff --git a/mobile/native/apple/apps/ensu/Ensu/Services/Logging/EnsuLogging.swift b/mobile/native/apple/apps/ensu/Ensu/Services/Logging/EnsuLogging.swift
index cecbd28d91..85b9ae0ed7 100644
--- a/mobile/native/apple/apps/ensu/Ensu/Services/Logging/EnsuLogging.swift
+++ b/mobile/native/apple/apps/ensu/Ensu/Services/Logging/EnsuLogging.swift
@@ -111,7 +111,9 @@ final class EnsuLogging {
func readLogText(fileURL: URL? = nil) -> String {
start()
let url = fileURL ?? todayLogFileURL()
- return (try? String(contentsOf: url, encoding: .utf8)) ?? ""
+ return queue.sync {
+ (try? String(contentsOf: url, encoding: .utf8)) ?? ""
+ }
}
func createLogsArchive() throws -> URL {