Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/beats into fix-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
michalpristas committed Mar 2, 2021
2 parents 9726d00 + f4b6a49 commit 57116a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 6 additions & 10 deletions filebeat/input/filestream/fswatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common/match"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/go-concert/timed"
"github.com/elastic/go-concert/unison"
)

Expand Down Expand Up @@ -118,16 +119,11 @@ func (w *fileWatcher) Run(ctx unison.Canceler) {
// run initial scan before starting regular
w.watch(ctx)

ticker := time.NewTicker(w.interval)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
w.watch(ctx)
}
}
timed.Periodic(ctx, w.interval, func() error {
w.watch(ctx)

return nil
})
}

func (w *fileWatcher) watch(ctx unison.Canceler) {
Expand Down
3 changes: 2 additions & 1 deletion x-pack/elastic-agent/pkg/config/operations/inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func LoadFullAgentConfig(cfgPath string) (*config.Config, error) {
if err != nil {
return nil, err
} else if fleetConfig == nil {
return nil, fmt.Errorf("no fleet config retrieved yet")
// resolving fleet config but not fleet config retrieved yet, returning last applied config
return rawConfig, nil
}

return config.NewConfigFrom(fleetConfig)
Expand Down

0 comments on commit 57116a1

Please sign in to comment.