How can I fix autosaveAllModels when running my database in background thread (iOS)?

Hi!

I’m running CBLDatabase in a dispatch queue of my own - following the concurrency guidelines (iOS app). However, when the app is minimized, autosaveAllModels: is getting called on the main thread. This causes a crash because the database is being used on the wrong thread. How can I make sure that autosaveAllModels runs, but on my queue?

Thanks!

// Mio

That’s a bug in Couchbase Lite, but no one’s noticed it before, so thanks for pointing it out. I’ve just filed a bug report:


I’ll see if I can post a workaround there.