You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns out that calling .sync will block the calling thread, so the fileIO is indeed blocking the main thread, because backupCache is called from either appWillTerminate or didEnterBackground methods.
The text was updated successfully, but these errors were encountered:
@Dean151 Thank you for reporting this. Unfortunately the Mastodon link you've posted does not work, maybe the post was deleted? In any case, the main problem with this code is that we kinda want to block the main thread before the app gets killed by the system. Or to be more precise: We want to avoid that the app gets killed while the write is in progress. If we simply put the write into a background thread, this could lead to data loss.
Related:
Thankfully, Marcin helped out to understand:
https://mastodon.social/@krzyzanowskim/111835373363274251
Turns out that calling .sync will block the calling thread, so the fileIO is indeed blocking the main thread, because backupCache is called from either appWillTerminate or didEnterBackground methods.
The text was updated successfully, but these errors were encountered: