Skip to content

Commit

Permalink
Fix incorrect behaviour when multiple watchers are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusWichelmann committed Aug 1, 2022
1 parent 7d86dc8 commit c1b52d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func initWatchers() {
}

// Create watcher.
w, err := watching.NewWatcher(&ac, filteredReceivers)
w, err := watching.NewWatcher(ac, filteredReceivers)
if err != nil {
log.WithField("app", ac.Name).WithError(err).Fatal("Cannot create app watcher.")
}
Expand Down
4 changes: 2 additions & 2 deletions watching/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

type Watcher struct {
App *config.AppConfig
App config.AppConfig
Receivers []notify.Receiver

timeout time.Duration
Expand All @@ -26,7 +26,7 @@ type Watcher struct {
logger *log.Entry
}

func NewWatcher(app *config.AppConfig, receivers []notify.Receiver) (*Watcher, error) {
func NewWatcher(app config.AppConfig, receivers []notify.Receiver) (*Watcher, error) {
// Parse durations.
timeout, err := time.ParseDuration(app.Timeout)
if err != nil {
Expand Down

0 comments on commit c1b52d1

Please sign in to comment.