mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
Move MustRegister back to init
This commit is contained in:
parent
1afd2c07a8
commit
1c3606e4aa
|
|
@ -73,6 +73,13 @@ var destinationQueueBackingOff = prometheus.NewGauge(
|
|||
},
|
||||
)
|
||||
|
||||
func init() {
|
||||
prometheus.MustRegister(
|
||||
destinationQueueTotal, destinationQueueRunning,
|
||||
destinationQueueBackingOff,
|
||||
)
|
||||
}
|
||||
|
||||
// NewOutgoingQueues makes a new OutgoingQueues
|
||||
func NewOutgoingQueues(
|
||||
db storage.Database,
|
||||
|
|
@ -84,10 +91,6 @@ func NewOutgoingQueues(
|
|||
statistics *statistics.Statistics,
|
||||
signing *SigningInfo,
|
||||
) *OutgoingQueues {
|
||||
prometheus.MustRegister(
|
||||
destinationQueueTotal, destinationQueueRunning,
|
||||
destinationQueueBackingOff,
|
||||
)
|
||||
queues := &OutgoingQueues{
|
||||
disabled: disabled,
|
||||
process: process,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,12 @@ var (
|
|||
)
|
||||
)
|
||||
|
||||
func init() {
|
||||
prometheus.MustRegister(
|
||||
deviceListUpdateCount,
|
||||
)
|
||||
}
|
||||
|
||||
// DeviceListUpdater handles device list updates from remote servers.
|
||||
//
|
||||
// In the case where we have the prev_id for an update, the updater just stores the update (after acquiring a per-user lock).
|
||||
|
|
@ -123,9 +129,6 @@ func NewDeviceListUpdater(
|
|||
db DeviceListUpdaterDatabase, api DeviceListUpdaterAPI, producer KeyChangeProducer,
|
||||
fedClient fedsenderapi.FederationClient, numWorkers int,
|
||||
) *DeviceListUpdater {
|
||||
prometheus.MustRegister(
|
||||
deviceListUpdateCount,
|
||||
)
|
||||
return &DeviceListUpdater{
|
||||
userIDToMutex: make(map[string]*sync.Mutex),
|
||||
mu: &sync.Mutex{},
|
||||
|
|
|
|||
Loading…
Reference in a new issue