How do I reconnect to MongoDB Atlas without having to wait 5 minutes?

I have a problem in my app with (flutter and realm) reconnecting to MongoDB Atlas.

The problem is the following: When I lose the internet connection, the application tries to connect to MongoDB Atlas every 5 minutes (that’s correct), the problem I have is that when I recover the connection I also have to wait for those 5 minutes, how can I do so that when the internet connection recovers it connects automatically without waiting those 5 minutes?

I have not found any information about it

Hi @rivars there is an exponential backoff associated with the sync-client attempting to reconnect which has a maximum of 5 minutes. This is because attempting to connect without a network is one of the more battery draining tasks an application can do. You can explicitly force a reconnect in user code by using the pause() and resume() APIs when you are back on the network -

3 Likes

thank you so much! it worked perfect!

I may have some kind of problem for doing this forcing synchronization?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.