Continue adopting MainActor.

This commit is contained in:
Brent Simmons
2023-07-09 11:41:42 -07:00
parent b49731cc34
commit 63cc39dc4f
15 changed files with 17 additions and 17 deletions

View File

@@ -28,7 +28,7 @@ final class ExtensionContainersFile: Logging {
}
@MainActor private let saveQueue = CoalescingQueue(name: "Save Queue", interval: 0.5)
init() {
@MainActor init() {
if !FileManager.default.fileExists(atPath: ExtensionContainersFile.filePath) {
save()
}
@@ -72,14 +72,14 @@ private extension ExtensionContainersFile {
saveQueue.add(self, #selector(saveToDiskIfNeeded))
}
@objc func saveToDiskIfNeeded() {
@MainActor @objc func saveToDiskIfNeeded() {
if isDirty {
isDirty = false
save()
}
}
func save() {
@MainActor func save() {
let encoder = PropertyListEncoder()
encoder.outputFormat = .binary