diff --git a/.vscode/launch.json b/.vscode/launch.json index 934ef79..116907e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "env":{ "SLIDESHOW_INTERVAL": "10", "SLIDESHOW_DIRECTORY": "/home/velvettear/images", - "SLIDESHOW_SCANINTERVAL": "10", + "SLIDESHOW_SCANINTERVAL": "300", "SLIDESHOW_RESOLUTION": "600x1024", "SLIDESHOW_LOGLEVEL": "debug", "SLIDESHOW_PALETTE": "/tmp/.slideshow.palette", diff --git a/scanner/scanner.go b/scanner/scanner.go index 04fcf09..0caf5ff 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -32,7 +32,7 @@ func GetRandomImage() string { // scan the specified directory func scan(directory string) { timestamp := time.Now().UnixMilli() - loggo.Info("scanning directory for images and subdirectories...", directory) + loggo.Info("scanning directory for images and subdirectories...", "interval: "+strconv.FormatFloat(config.ScanInterval.Seconds(), 'f', 0, 64)+" seconds", directory) filepath.WalkDir(directory, checkDirectory) images = tmpImages tmpImages = nil @@ -42,7 +42,7 @@ func scan(directory string) { // sleep the specified interval and then trigger a rescan of the specified directory func scheduleRescan(directory string) { - loggo.Debug("sleeping for " + strconv.FormatInt(config.Interval.Milliseconds(), 10) + "ms before next scan...") + loggo.Debug("sleeping for " + strconv.FormatInt(config.ScanInterval.Milliseconds(), 10) + "ms before next scan...") time.Sleep(config.ScanInterval) scan(directory) }