explain code per review comments
This commit is contained in:
parent
1fc3c7c2b9
commit
302cee8319
1 changed files with 2 additions and 0 deletions
|
@ -202,6 +202,8 @@ func NewNGINXController(config *Configuration, mc metric.Collector) *NGINXContro
|
|||
}
|
||||
|
||||
for _, f := range filesToWatch {
|
||||
// This redeclaration is necessary for the closure to get the correct value for the iteration in go versions <1.22
|
||||
// See https://go.dev/blog/loopvar-preview
|
||||
f := f
|
||||
_, err = file.NewFileWatcher(f, func() {
|
||||
klog.InfoS("File change detected. Reloading NGINX", "path", f)
|
||||
|
|
Loading…
Reference in a new issue