Configure timeout and retries when testing connection status (#623)

This commit is contained in:
Dan Sosedoff
2022-12-19 16:13:43 -06:00
committed by GitHub
parent 362ecb0bc7
commit 4e3e255575
2 changed files with 33 additions and 1 deletions

View File

@@ -453,8 +453,14 @@ func GetHistory(c *gin.Context) {
// GetConnectionInfo renders information about current connection
func GetConnectionInfo(c *gin.Context) {
res, err := DB(c).Info()
conn := DB(c)
if err := conn.TestWithTimeout(5 * time.Second); err != nil {
badRequest(c, err)
return
}
res, err := conn.Info()
if err != nil {
badRequest(c, err)
return