Skip to content

Commit

Permalink
feat: add interval as config param
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Jun 9, 2022
1 parent 2c51894 commit 9fef362
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Config struct {
LogConfig LogConfig `toml:"log"`
StatePath string `toml:"state-path"`
Chains []Chain `toml:"chains"`
Interval int64 `toml:"interval" default:"30"`
}

type PagerDutyConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Execute(configPath string) {

if report.Empty() {
log.Debug().Msg("Empty report, not sending.")
time.Sleep(time.Second * 30)
time.Sleep(time.Second * time.Duration(config.Interval))
continue
}

Expand All @@ -54,7 +54,7 @@ func Execute(configPath string) {
}
}

time.Sleep(time.Second * 30)
time.Sleep(time.Second * time.Duration(config.Interval))
}
}

Expand Down

0 comments on commit 9fef362

Please sign in to comment.