mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
internal/clientinfo: remove dhcp from refresher list
dhcp lease files are watched separately using fsnotify, it does not need to be in refresher list.
This commit is contained in:
committed by
Cuong Manh Le
parent
d6768c4c39
commit
2cd8b7e021
@@ -95,13 +95,12 @@ func (t *Table) Init() {
|
||||
if t.discoverDHCP() {
|
||||
t.dhcp = &dhcp{selfIP: t.selfIP}
|
||||
ctrld.ProxyLog.Debug().Msg("start dhcp discovery")
|
||||
if err := t.dhcp.refresh(); err != nil {
|
||||
if err := t.dhcp.init(); err != nil {
|
||||
ctrld.ProxyLog.Error().Err(err).Msg("could not init DHCP discover")
|
||||
} else {
|
||||
t.ipResolvers = append(t.ipResolvers, t.dhcp)
|
||||
t.macResolvers = append(t.macResolvers, t.dhcp)
|
||||
t.hostnameResolvers = append(t.hostnameResolvers, t.dhcp)
|
||||
t.refreshers = append(t.refreshers, t.dhcp)
|
||||
}
|
||||
go t.dhcp.watchChanges()
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ type dhcp struct {
|
||||
selfIP string
|
||||
}
|
||||
|
||||
func (d *dhcp) refresh() error {
|
||||
func (d *dhcp) init() error {
|
||||
watcher, err := fsnotify.NewWatcher()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user