Skip to content

Commit

Permalink
Use SSH.UpdateInterval value
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Jan 13, 2025
1 parent 3061f12 commit 15669bf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/demo/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ type Downloader struct {
}

func (d Downloader) Start(ctx context.Context) {
ticker := time.NewTicker(time.Second * 5)
seconds := d.config.Config().SSH.UpdateInterval
interval := time.Duration(seconds) * time.Second
if interval < time.Minute*5 {
slog.Error("Interval is too short, overriding to 5 minutes", slog.Duration("interval", interval))
interval = time.Minute * 5
}

ticker := time.NewTicker(interval)
for {
select {
case <-ticker.C:
Expand Down

0 comments on commit 15669bf

Please sign in to comment.