mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-23 22:36:29 +03:00
Remove unnecessary selects
This commit is contained in:
@@ -57,17 +57,15 @@ func (a *admin) init(c *Core) {
|
||||
a.reconfigure = make(chan chan error, 1)
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case e := <-a.reconfigure:
|
||||
a.core.configMutex.RLock()
|
||||
if a.core.config.AdminListen != a.core.configOld.AdminListen {
|
||||
a.listenaddr = a.core.config.AdminListen
|
||||
a.close()
|
||||
a.start()
|
||||
}
|
||||
a.core.configMutex.RUnlock()
|
||||
e <- nil
|
||||
e := <-a.reconfigure
|
||||
a.core.configMutex.RLock()
|
||||
if a.core.config.AdminListen != a.core.configOld.AdminListen {
|
||||
a.listenaddr = a.core.config.AdminListen
|
||||
a.close()
|
||||
a.start()
|
||||
}
|
||||
a.core.configMutex.RUnlock()
|
||||
e <- nil
|
||||
}
|
||||
}()
|
||||
a.core.configMutex.RLock()
|
||||
|
||||
Reference in New Issue
Block a user