settings: reload also on file creation (when rsync do atomic moves)

This commit is contained in:
nemunaire 2020-01-17 07:00:40 +01:00
parent 9c9d4edd74
commit f251d30162
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}