making sure we don't panic if globalReplicationStats have not been set (#20427)

This commit is contained in:
Sveinn 2024-09-12 11:39:51 +00:00 committed by GitHub
parent 3bae73fb42
commit 15ab0808b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -310,7 +310,12 @@ type ReplQNodeStats struct {
func (r *ReplicationStats) getNodeQueueStats(bucket string) (qs ReplQNodeStats) {
qs.NodeName = globalLocalNodeName
qs.Uptime = UTCNow().Unix() - globalBootTime.Unix()
qs.ActiveWorkers = globalReplicationStats.Load().ActiveWorkers()
grs := globalReplicationStats.Load()
if grs != nil {
qs.ActiveWorkers = grs.ActiveWorkers()
} else {
qs.ActiveWorkers = ActiveWorkerStat{}
}
qs.XferStats = make(map[RMetricName]XferStats)
qs.QStats = r.qCache.getBucketStats(bucket)
qs.TgtXferStats = make(map[string]map[RMetricName]XferStats)