From da6f025c7c590799fe8de009bfa694cf51f9c99a Mon Sep 17 00:00:00 2001 From: Tordarus Date: Thu, 16 Jan 2025 13:47:43 +0100 Subject: [PATCH] syncthing debug fix --- main.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 2570db7..a9e1b3c 100644 --- a/main.go +++ b/main.go @@ -17,11 +17,12 @@ import ( ) var ( // flags - FlagSourceDir = envvars.String("SOURCE_PATH", "/video") - FlagTargetDir = envvars.String("TARGET_PATH", "/audio") - FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin") - FlagExcludeFiles = envvars.StringSlice("EXCLUDE_FILES", ":", []string{".songs", ".stversions"}) - FlagUpdateCacheFileInterval = envvars.Duration("UPDATE_CACHE_FILE_INTERVAL", 10*time.Second) + FlagSourceDir = envvars.String("SOURCE_PATH", "/video") + FlagTargetDir = envvars.String("TARGET_PATH", "/audio") + FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin") + FlagExcludeFiles = envvars.StringSlice("EXCLUDE_FILES", ":", []string{".songs", ".stversions"}) + FlagUpdateCacheFileInterval = envvars.Duration("UPDATE_CACHE_FILE_INTERVAL", 10*time.Second) + FlagGroupMultipleFileChangesByTime = envvars.Duration("GROUP_FILE_CHANGES_INTERVAL", 10*time.Second) ) func main() { @@ -57,7 +58,7 @@ func main() { return s }) - groupedFiles := channel.GroupByTime(files, time.Second, func(events map[string]struct{}, event string) map[string]struct{} { + groupedFiles := channel.GroupByTime(files, FlagGroupMultipleFileChangesByTime, func(events map[string]struct{}, event string) map[string]struct{} { if events == nil { events = map[string]struct{}{} }