diff --git a/slideshow.go b/slideshow.go index 4a65764..15d2718 100644 --- a/slideshow.go +++ b/slideshow.go @@ -11,7 +11,8 @@ import ( func slideshow(ch <-chan string) { dir := <-ch - ticker := time.NewTicker(time.Duration(config.Duration) * time.Minute) + duration := time.Duration(config.Duration) * time.Minute + ticker := time.NewTicker(duration) go func() { for { @@ -23,6 +24,7 @@ func slideshow(ch <-chan string) { select { case dir = <-ch: log.Println("directory set!") + ticker.Reset(duration) continue case <-ticker.C: continue