Browse Source

fix race condition

pull/80/head
aler9 5 years ago
parent
commit
4afe8428c8
  1. 2
      path.go
  2. 4
      source.go

2
path.go

@ -59,7 +59,7 @@ func (pa *path) log(format string, args ...interface{}) { @@ -59,7 +59,7 @@ func (pa *path) log(format string, args ...interface{}) {
func (pa *path) onInit() {
if pa.source != nil {
go pa.source.run()
go pa.source.run(pa.source.state)
}
if pa.confp.RunOnInit != "" {

4
source.go

@ -66,8 +66,8 @@ func newSource(p *program, path *path, confp *confPath) *source { @@ -66,8 +66,8 @@ func newSource(p *program, path *path, confp *confPath) *source {
func (s *source) isPublisher() {}
func (s *source) run() {
s.applyState(s.state)
func (s *source) run(initialState sourceState) {
s.applyState(initialState)
outer:
for {

Loading…
Cancel
Save