Skip to content

Commit

Permalink
chore: warn on intervals below 30s
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jul 16, 2023
1 parent a0dfabb commit 2702661
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,10 @@ func (site *Site) loopLoadpoints(next chan<- Updater) {
func (site *Site) Run(stopC chan struct{}, interval time.Duration) {
site.Health = NewHealth(time.Minute + interval)

if max := 30 * time.Second; interval < max {
site.log.WARN.Printf("interval <%.0fs can lead to unexpected behavior, see https://docs.evcc.io/docs/reference/configuration/interval", max.Seconds())
}

loadpointChan := make(chan Updater)
go site.loopLoadpoints(loadpointChan)

Expand Down

0 comments on commit 2702661

Please sign in to comment.