settings: reload also on file creation (when rsync do atomic moves)
This commit is contained in:
parent
9c9d4edd74
commit
f251d30162
|
@ -156,7 +156,7 @@ func LoadAndWatchSettings(settingsPath string, reload func (FICSettings)) {
|
|||
for {
|
||||
select {
|
||||
case ev := <-watcher.Events:
|
||||
if path.Base(ev.Name) == SettingsFile && ev.Op & fsnotify.Write == fsnotify.Write {
|
||||
if path.Base(ev.Name) == SettingsFile && ev.Op & (fsnotify.Write | fsnotify.Create) != 0 {
|
||||
log.Println("Settings file changes, reloading it!")
|
||||
go tryReload(settingsPath, reload)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue