Explorar el Código

db: skip ping when not available (#6687)

Joe Chen hace 3 años
padre
commit
7878465567
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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()
 }