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
Ping, after the first connection, doesn't actually ping the database. It's odd, and wrong, but that's the way it works (until Go 1.8). If there's an existing connection in the connection pool that hasn't timed out, Ping will simply remove it from the pool and return it to you, without actually bothering to check if the database is still there.
Kardianos (who wrote the above linked document, as well as Govendor) fixed this in 1.8, provided the database driver supports it. Until then, however, Ping isn't reliable for determining if the database is still there.
Hello.
Is it ok now to use ping now to check if my connection is still there?
Thanks a lot
The text was updated successfully, but these errors were encountered:
https://stackoverflow.com/questions/41618428/golang-ping-succeed-the-second-time-even-if-database-is-down
Hello.
Is it ok now to use ping now to check if my connection is still there?
Thanks a lot
The text was updated successfully, but these errors were encountered: