cmd/ctrld: do client info table init in separated goroutine

So it won't cause the listener take more times to be ready.
This commit is contained in:
Cuong Manh Le
2023-07-18 18:07:46 +07:00
committed by Cuong Manh Le
parent 9ed8e49a08
commit 2cd063ebd6

View File

@@ -115,8 +115,11 @@ func (p *prog) run() {
format := ctrld.LeaseFileFormat(p.cfg.Service.DHCPLeaseFileFormat)
p.ciTable.AddLeaseFile(leaseFile, format)
}
p.ciTable.Init()
go p.ciTable.RefreshLoop(p.stopCh)
go func() {
p.ciTable.Init()
p.ciTable.RefreshLoop(p.stopCh)
}()
go p.watchLinkState()
for listenerNum := range p.cfg.Listener {