syncthing debug fix

This commit is contained in:
Tordarus 2025-01-16 13:47:43 +01:00
parent 224742d008
commit da6f025c7c

13
main.go
View File

@ -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{}{}
}