mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Slower federation warm-up (#2320)
* Wake destination queues gradually, rather than all at once * Delay device list updates too * Maximum two minute warmup period
This commit is contained in:
parent
6748a2a823
commit
9b316ac64c
2 changed files with 30 additions and 20 deletions
|
@ -157,8 +157,15 @@ func (u *DeviceListUpdater) Start() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
offset, step := time.Second*10, time.Second
|
||||
if max := len(staleLists); max > 120 {
|
||||
step = (time.Second * 120) / time.Duration(max)
|
||||
}
|
||||
for _, userID := range staleLists {
|
||||
u.notifyWorkers(userID)
|
||||
time.AfterFunc(offset, func() {
|
||||
u.notifyWorkers(userID)
|
||||
})
|
||||
offset += step
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue