Skip to content

Commit d7b7f96

Browse files
🐛 Fix potential race condition w/ async task
1 parent 578bd15 commit d7b7f96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

phpmon/Domain/App/Startup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Startup {
2222
Log.info("The user is running PHP Monitor with the architecture: \(App.architecture)")
2323

2424
// Set up a "background" timer on the main thread
25-
Task { @MainActor in
25+
await MainActor.run {
2626
startStartupTimer()
2727
}
2828

phpmon/Domain/Menu/MainMenu+Startup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension MainMenu {
1515
*/
1616
func startup() async {
1717
// Start with the icon
18-
Task { @MainActor in
18+
await MainActor.run {
1919
self.setStatusBar(image: NSImage.statusBarIcon)
2020
}
2121

0 commit comments

Comments
 (0)