1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Fix dial call if it is nil

This commit is contained in:
mcrakhman 2025-01-20 23:13:40 +01:00
parent 4e57651f66
commit f2fea0b795
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -30,7 +30,10 @@ func registerMetrics(ref *prometheus.Registry, sp *streamPool, name string) {
Name: "dial_queue",
Help: "dial queue size",
}, func() float64 {
return float64(sp.dial.batch.Len())
if sp.dial != nil {
return float64(sp.dial.batch.Len())
}
return 0
}),
)
}