mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 01:38:30 +02:00
simplify task package implementation
This commit is contained in:
@@ -16,8 +16,10 @@ var (
|
||||
func NewConfigFileWatcher(filename string) Watcher {
|
||||
configDirWatcherMu.Lock()
|
||||
defer configDirWatcherMu.Unlock()
|
||||
|
||||
if configDirWatcher == nil {
|
||||
configDirWatcher = NewDirectoryWatcher(task.GlobalTask("config watcher"), common.ConfigBasePath)
|
||||
t := task.RootTask("config_dir_watcher", false)
|
||||
configDirWatcher = NewDirectoryWatcher(t, common.ConfigBasePath)
|
||||
}
|
||||
return configDirWatcher.Add(filename)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user