Skip to content

Commit

Permalink
fixed: dataConfig每次只接收1个事件的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
phantacix committed Nov 10, 2023
1 parent 8765355 commit 2687798
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/data-config/source_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ func (f *SourceFile) Init(_ IDataConfig) {

// new watcher
go f.newWatcher()

err = f.watcher.Start(time.Duration(f.ReloadTime) * time.Millisecond)
if err != nil {
clog.Panic(err)
}
}

func (f *SourceFile) ReadBytes(configName string) ([]byte, error) {
Expand Down Expand Up @@ -120,6 +115,11 @@ func (f *SourceFile) newWatcher() {
}
}
}()

err := f.watcher.Start(time.Duration(f.ReloadTime) * time.Millisecond)
if err != nil {
clog.Panic(err)
}
}

func (f *SourceFile) Stop() {
Expand Down

0 comments on commit 2687798

Please sign in to comment.