There is a CBLModel save: executed on the local database while in the background. As you see in the second Log (from when the app goes to foreground), when the app goes to foreground the Pusher is executed to perform that operation that was scheduled in the background. I'm not saying the thread is dead, but for some reason some stuff the operation are not executed in the background when using beginBackgroundTaskWithExpirationHandler: <https://www.google.com/url?q=https%3A%2F%2Fdeveloper.apple.com%2Flibrary%2Fios%2Fdocumentation%2FUIKit%2FReference%2FUIApplication_Class%2Findex.html%23%2F%2Fapple_ref%2Focc%2Finstm%2FUIApplication%2FbeginBackgroundTaskWithExpirationHandler%3A&sa=D&sntz=1&usg=AFQjCNHBGRNs77KA_wNeHPykqYpOHo59dA> and I think is my have something to do with threading in that those operations run on a different thread than the thread calling beginBackgroundTaskWithExpirationHandler: <https://www.google.com/url?q=https%3A%2F%2Fdeveloper.apple.com%2Flibrary%2Fios%2Fdocumentation%2FUIKit%2FReference%2FUIApplication_Class%2Findex.html%23%2F%2Fapple_ref%2Focc%2Finstm%2FUIApplication%2FbeginBackgroundTaskWithExpirationHandler%3A&sa=D&sntz=1&usg=AFQjCNHBGRNs77KA_wNeHPykqYpOHo59dA>. But again, that is just a hint that I cannot probe yet.
On Tuesday, January 20, 2015 at 2:32:05 PM UTC-2, Jens Alfke wrote: > > > On Jan 20, 2015, at 8:10 AM, Martin Palatnik <[email protected] > <javascript:>> wrote: > > Below is a detailed log of couchbase. After 60 sec I call a timer to > finish the background task and set the suspended to YES. As you will see > the CBL_Pusher is never executing. Couchbase stops doing things after 10 > secs. The timer also in the background is called after 60 secs. > > > I don't see any sign of a push replication in the logs, although the pull > replicator runs normally. So the problem is either that there's no push > replication, or there was no change made to the local database to trigger > it to do anything. > > This doesn't have anything to do with threads or the OS's background task > timer, because both push and pull replications run on the same thread. So > since the pull replication is doing stuff, the thread is alive and well. > > —Jens > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/889f273b-b273-4554-84bc-462aa714344f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
