StatsColelctor: Check if result is nil before set the metrics (#59372)
Check if result is nil before set the metrics
This commit is contained in:
1 parent
64143ea7d0
commit
92e3ee7d89
1 file changed
+5
@@ -321,6 +321,11 @@ func (s *Service) updateTotalStats(ctx context.Context) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if statsQuery.Result == nil {
|
||||
s.log.Error("Cannot retrieve system stats")
|
||||
return false
|
||||
}
|
||||
|
||||
metrics.MStatTotalDashboards.Set(float64(statsQuery.Result.Dashboards))
|
||||
metrics.MStatTotalFolders.Set(float64(statsQuery.Result.Folders))
|
||||
metrics.MStatTotalUsers.Set(float64(statsQuery.Result.Users))
|
||||
|
||||
Reference in new issue
Block a user