bugfix: Start filewatcher on different goroutines (#286)
This commit is contained in:
parent
8f1dfffa49
commit
5057ba2e1c
|
|
@ -35,9 +35,11 @@ func SetupEntityFileWatchers(cfg *config.Config) {
|
||||||
}).Debugf("Adding config dir to entity file path")
|
}).Debugf("Adding config dir to entity file path")
|
||||||
}
|
}
|
||||||
|
|
||||||
filehelper.WatchFileWrite(p, func(filename string) {
|
go filehelper.WatchFileWrite(p, func(filename string) {
|
||||||
loadEntityFile(p, ef.Name)
|
loadEntityFile(p, ef.Name)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
loadEntityFile(p, ef.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ import (
|
||||||
func WatchFilesInDirectory(cfg *config.Config, ex *executor.Executor) {
|
func WatchFilesInDirectory(cfg *config.Config, ex *executor.Executor) {
|
||||||
for _, action := range cfg.Actions {
|
for _, action := range cfg.Actions {
|
||||||
for _, dirname := range action.ExecOnFileChangedInDir {
|
for _, dirname := range action.ExecOnFileChangedInDir {
|
||||||
filehelper.WatchDirectoryWrite(dirname, func(filename string) {
|
go filehelper.WatchDirectoryWrite(dirname, func(filename string) {
|
||||||
scheduleExec(action, cfg, ex, filename)
|
scheduleExec(action, cfg, ex, filename)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, dirname := range action.ExecOnFileCreatedInDir {
|
for _, dirname := range action.ExecOnFileCreatedInDir {
|
||||||
filehelper.WatchDirectoryCreate(dirname, func(filename string) {
|
go filehelper.WatchDirectoryCreate(dirname, func(filename string) {
|
||||||
scheduleExec(action, cfg, ex, filename)
|
scheduleExec(action, cfg, ex, filename)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue