change ping db logic

The load balancer test endpoint `/test` is doing a ping to mongodb and a timeout check.

The problem is that when the primary of mongodb is not reachable the client library takes more time to connect.

But the `/test` is being hit constantly, and it will timeout. When the test timeout the process crash.

I've changed the logic to use mongodb heartbeat when the connection is available as the other process.