mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-03 04:03:09 -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
|
// NewOutgoingQueues makes a new OutgoingQueues
|
||||||
func NewOutgoingQueues(
|
func NewOutgoingQueues(
|
||||||
db storage.Database,
|
db storage.Database,
|
||||||
|
|
@ -84,10 +91,6 @@ func NewOutgoingQueues(
|
||||||
statistics *statistics.Statistics,
|
statistics *statistics.Statistics,
|
||||||
signing *SigningInfo,
|
signing *SigningInfo,
|
||||||
) *OutgoingQueues {
|
) *OutgoingQueues {
|
||||||
prometheus.MustRegister(
|
|
||||||
destinationQueueTotal, destinationQueueRunning,
|
|
||||||
destinationQueueBackingOff,
|
|
||||||
)
|
|
||||||
queues := &OutgoingQueues{
|
queues := &OutgoingQueues{
|
||||||
disabled: disabled,
|
disabled: disabled,
|
||||||
process: process,
|
process: process,
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,12 @@ var (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
prometheus.MustRegister(
|
||||||
|
deviceListUpdateCount,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// DeviceListUpdater handles device list updates from remote servers.
|
// 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).
|
// 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,
|
db DeviceListUpdaterDatabase, api DeviceListUpdaterAPI, producer KeyChangeProducer,
|
||||||
fedClient fedsenderapi.FederationClient, numWorkers int,
|
fedClient fedsenderapi.FederationClient, numWorkers int,
|
||||||
) *DeviceListUpdater {
|
) *DeviceListUpdater {
|
||||||
prometheus.MustRegister(
|
|
||||||
deviceListUpdateCount,
|
|
||||||
)
|
|
||||||
return &DeviceListUpdater{
|
return &DeviceListUpdater{
|
||||||
userIDToMutex: make(map[string]*sync.Mutex),
|
userIDToMutex: make(map[string]*sync.Mutex),
|
||||||
mu: &sync.Mutex{},
|
mu: &sync.Mutex{},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue