mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/config: allow multiple prioritized backfill limit override keys
This commit is contained in:
parent
f6d8362278
commit
4efa4bdac5
1 changed files with 7 additions and 5 deletions
|
|
@ -34,10 +34,12 @@ type BackfillQueueConfig struct {
|
|||
MaxBatchesOverride map[string]int `yaml:"max_batches_override"`
|
||||
}
|
||||
|
||||
func (bqc *BackfillQueueConfig) GetOverride(name string) int {
|
||||
override, ok := bqc.MaxBatchesOverride[name]
|
||||
if !ok {
|
||||
return bqc.MaxBatches
|
||||
func (bqc *BackfillQueueConfig) GetOverride(names ...string) int {
|
||||
for _, name := range names {
|
||||
override, ok := bqc.MaxBatchesOverride[name]
|
||||
if ok {
|
||||
return override
|
||||
}
|
||||
}
|
||||
return override
|
||||
return bqc.MaxBatches
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue