Ver código fonte

db: skip ping when not available (#6687)

Joe Chen 3 anos atrás
pai
commit
7878465567
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      internal/db/models.go

+ 3 - 0
internal/db/models.go

@@ -231,6 +231,9 @@ func GetStatistic() (stats Statistic) {
 }
 
 func Ping() error {
+	if x == nil {
+		return errors.New("database not available")
+	}
 	return x.Ping()
 }