Move responsibility for configuring max queue size into switch

This commit is contained in:
Neil Alexander 2019-08-28 19:39:23 +01:00
parent fc9a1c6c31
commit aa0770546e
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 7 additions and 9 deletions

View file

@ -152,14 +152,6 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) (*config.NodeState,
return nil, err
}
c.config.Mutex.RLock()
if c.config.Current.SwitchOptions.MaxTotalQueueSize >= SwitchQueueTotalMinSize {
phony.Block(&c.switchTable, func() {
c.switchTable.queues.totalMaxSize = c.config.Current.SwitchOptions.MaxTotalQueueSize
})
}
c.config.Mutex.RUnlock()
if err := c.switchTable.start(); err != nil {
c.log.Errorln("Failed to start switch")
return nil, err