reset ticker on directory change
This commit is contained in:
parent
bd63efeeb7
commit
8988cab87d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue