Fix main-thread blocking I/O

This commit is contained in:
世界
2026-02-05 02:37:02 +08:00
parent 4ae421cd04
commit 2e682d746c
17 changed files with 643 additions and 237 deletions
+4 -5
View File
@@ -193,7 +193,7 @@ public class ExtensionProfile: ObservableObject {
])
}
let configContent = try profile.read()
let configContent = try await profile.readAsync()
options["configContent"] = NSString(string: configContent)
options["ignoreMemoryLimit"] = await NSNumber(value: SharedPreferences.ignoreMemoryLimit.get())
@@ -215,10 +215,9 @@ public class ExtensionProfile: ObservableObject {
}
public func fetchProfile() async throws {
if let profile = try await ProfileManager.get(Int64(SharedPreferences.selectedProfileID.get())) {
if profile.type == .icloud {
_ = try profile.read()
}
let profileID = await SharedPreferences.selectedProfileID.get()
if let profile = try await ProfileManager.get(profileID), profile.type == .icloud {
_ = try await profile.readAsync()
}
}