Watch bool
This commit is contained in:
parent
0a09a78cac
commit
4558270c42
3 changed files with 14 additions and 6 deletions
5
file.go
5
file.go
|
@ -10,6 +10,7 @@ import (
|
|||
)
|
||||
|
||||
type FileProvider struct {
|
||||
Watch bool
|
||||
Filename string
|
||||
}
|
||||
|
||||
|
@ -45,7 +46,9 @@ func (provider *FileProvider) Provide(serviceChan chan<- *Service){
|
|||
}
|
||||
}()
|
||||
|
||||
err = watcher.Add(filepath.Dir(file.Name()))
|
||||
if(provider.Watch){
|
||||
err = watcher.Add(filepath.Dir(file.Name()))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue