fix: prevent queries from starting before initialization (#18756)

Prevent queries from starting before initialization
This commit is contained in:
jiuker 2024-01-09 04:40:27 +08:00 committed by GitHub
parent 2cd98a0d21
commit 53ceb0791f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -2021,6 +2021,11 @@ func getReplicationClusterMetrics() *MetricsGroup {
mg.RegisterRead(func(_ context.Context) []Metric { mg.RegisterRead(func(_ context.Context) []Metric {
var ml []Metric var ml []Metric
objLayer := newObjectLayerFn()
// Service not initialized yet
if objLayer == nil {
return ml
}
// common operational metrics for bucket replication and site replication - published // common operational metrics for bucket replication and site replication - published
// at cluster level // at cluster level
if globalReplicationStats != nil { if globalReplicationStats != nil {