File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,21 @@ import BackgroundTasks
5858
5959 // Schedule background synchronization task
6060 BGTaskScheduler . shared. register ( forTaskWithIdentifier: Self . longBackgroundSyncID, using: nil ) { task in
61- Task { await self . handleBackgroundSync ( task: task) }
61+ Task { @MainActor in
62+ await self . handleBackgroundSync ( task: task)
63+ }
6264 }
6365
6466 BGTaskScheduler . shared. register ( forTaskWithIdentifier: Self . shortBackgroundSyncID, using: nil ) { task in
65- Task { await self . handleBackgroundSync ( task: task) }
67+ Task { @MainActor in
68+ await self . handleBackgroundSync ( task: task)
69+ }
6670 }
6771
6872 BGTaskScheduler . shared. register ( forTaskWithIdentifier: Self . continuedBackgroundSyncID, using: nil ) { task in
69- Task { await self . handleBackgroundSync ( task: task) }
73+ Task { @MainActor in
74+ await self . handleBackgroundSync ( task: task)
75+ }
7076 }
7177
7278 updateBackgroundRunHistory ( appending: nil )
You can’t perform that action at this time.
0 commit comments