From 15669bf844620fe661fcfbb443f0e366dd5a5745 Mon Sep 17 00:00:00 2001 From: Leigh MacDonald Date: Mon, 13 Jan 2025 00:30:09 -0700 Subject: [PATCH] Use SSH.UpdateInterval value --- internal/demo/fetcher.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/demo/fetcher.go b/internal/demo/fetcher.go index dbbc17e5..bee5e604 100644 --- a/internal/demo/fetcher.go +++ b/internal/demo/fetcher.go @@ -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: