mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 15:03:09 -06:00
Make the worker count configurable
This commit is contained in:
parent
210f108306
commit
e7996edf65
|
|
@ -325,6 +325,10 @@ user_api:
|
||||||
auto_join_rooms:
|
auto_join_rooms:
|
||||||
# - "#main:matrix.org"
|
# - "#main:matrix.org"
|
||||||
|
|
||||||
|
# The number of device list updater workers to start. Defaults to 8.
|
||||||
|
# This only needs updating if the "InputDeviceListUpdate" stream keeps growing indefinitely.
|
||||||
|
# worker_count: 8
|
||||||
|
|
||||||
# Configuration for Opentracing.
|
# Configuration for Opentracing.
|
||||||
# See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on
|
# See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on
|
||||||
# how this works and how to set it up.
|
# how this works and how to set it up.
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ type UserAPI struct {
|
||||||
// Users who register on this homeserver will automatically
|
// Users who register on this homeserver will automatically
|
||||||
// be joined to the rooms listed under this option.
|
// be joined to the rooms listed under this option.
|
||||||
AutoJoinRooms []string `yaml:"auto_join_rooms"`
|
AutoJoinRooms []string `yaml:"auto_join_rooms"`
|
||||||
|
|
||||||
|
// The number of workers to start for the DeviceListUpdater.
|
||||||
|
// Setting this too low may result in the "InputDeviceListUpdate" growing forever.
|
||||||
|
WorkerCount int `yaml:"worker_count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultOpenIDTokenLifetimeMS = 3600000 // 60 minutes
|
const DefaultOpenIDTokenLifetimeMS = 3600000 // 60 minutes
|
||||||
|
|
@ -28,6 +32,7 @@ const DefaultOpenIDTokenLifetimeMS = 3600000 // 60 minutes
|
||||||
func (c *UserAPI) Defaults(opts DefaultOpts) {
|
func (c *UserAPI) Defaults(opts DefaultOpts) {
|
||||||
c.BCryptCost = bcrypt.DefaultCost
|
c.BCryptCost = bcrypt.DefaultCost
|
||||||
c.OpenIDTokenLifetimeMS = DefaultOpenIDTokenLifetimeMS
|
c.OpenIDTokenLifetimeMS = DefaultOpenIDTokenLifetimeMS
|
||||||
|
c.WorkerCount = 8
|
||||||
if opts.Generate {
|
if opts.Generate {
|
||||||
if !opts.SingleDatabase {
|
if !opts.SingleDatabase {
|
||||||
c.AccountDatabase.ConnectionString = "file:userapi_accounts.db"
|
c.AccountDatabase.ConnectionString = "file:userapi_accounts.db"
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ func NewInternalAPI(
|
||||||
FedClient: fedClient,
|
FedClient: fedClient,
|
||||||
}
|
}
|
||||||
|
|
||||||
updater := internal.NewDeviceListUpdater(processContext, keyDB, userAPI, keyChangeProducer, fedClient, 8, rsAPI, dendriteCfg.Global.ServerName, enableMetrics) // 8 workers TODO: configurable
|
updater := internal.NewDeviceListUpdater(processContext, keyDB, userAPI, keyChangeProducer, fedClient, dendriteCfg.UserAPI.WorkerCount, rsAPI, dendriteCfg.Global.ServerName, enableMetrics)
|
||||||
userAPI.Updater = updater
|
userAPI.Updater = updater
|
||||||
// Remove users which we don't share a room with anymore
|
// Remove users which we don't share a room with anymore
|
||||||
if err := updater.CleanUp(); err != nil {
|
if err := updater.CleanUp(); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue