mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Move responsibility for configuring max queue size into switch
This commit is contained in:
parent
fc9a1c6c31
commit
aa0770546e
2 changed files with 7 additions and 9 deletions
|
@ -193,7 +193,13 @@ func (t *switchTable) init(core *Core) {
|
|||
t.table.Store(lookupTable{})
|
||||
t.drop = make(map[crypto.SigPubKey]int64)
|
||||
phony.Block(t, func() {
|
||||
t.queues.totalMaxSize = SwitchQueueTotalMinSize
|
||||
core.config.Mutex.RLock()
|
||||
if core.config.Current.SwitchOptions.MaxTotalQueueSize > SwitchQueueTotalMinSize {
|
||||
t.queues.totalMaxSize = core.config.Current.SwitchOptions.MaxTotalQueueSize
|
||||
} else {
|
||||
t.queues.totalMaxSize = SwitchQueueTotalMinSize
|
||||
}
|
||||
core.config.Mutex.RUnlock()
|
||||
t.queues.bufs = make(map[string]switch_buffer)
|
||||
t.idle = make(map[switchPort]time.Time)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue