1
0
Эх сурвалжийг харах

db: skip ping when not available (#6687)

Joe Chen 3 жил өмнө
parent
commit
7878465567
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  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()
 }