mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
Some tweaks for the device list updater (#3251)
This makes the following changes: - Adds two new metrics observing the usage of the `DeviceListUpdater` workers - Makes the number of workers configurable - Adds a 30s timeout for DB requests when receiving a device list update over federation
This commit is contained in:
parent
32f7c4b166
commit
da7bca0224
18 changed files with 92 additions and 47 deletions
|
@ -46,6 +46,7 @@ func NewInternalAPI(
|
|||
natsInstance *jetstream.NATSInstance,
|
||||
rsAPI rsapi.UserRoomserverAPI,
|
||||
fedClient fedsenderapi.KeyserverFederationAPI,
|
||||
enableMetrics bool,
|
||||
) *internal.UserInternalAPI {
|
||||
js, _ := natsInstance.Prepare(processContext, &dendriteCfg.Global.JetStream)
|
||||
appServices := dendriteCfg.Derived.ApplicationServices
|
||||
|
@ -99,7 +100,7 @@ func NewInternalAPI(
|
|||
FedClient: fedClient,
|
||||
}
|
||||
|
||||
updater := internal.NewDeviceListUpdater(processContext, keyDB, userAPI, keyChangeProducer, fedClient, 8, rsAPI, dendriteCfg.Global.ServerName) // 8 workers TODO: configurable
|
||||
updater := internal.NewDeviceListUpdater(processContext, keyDB, userAPI, keyChangeProducer, fedClient, dendriteCfg.UserAPI.WorkerCount, rsAPI, dendriteCfg.Global.ServerName, enableMetrics)
|
||||
userAPI.Updater = updater
|
||||
// Remove users which we don't share a room with anymore
|
||||
if err := updater.CleanUp(); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue