syncthing debug fix

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

View File

@ -22,6 +22,7 @@ var ( // flags
FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin") FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin")
FlagExcludeFiles = envvars.StringSlice("EXCLUDE_FILES", ":", []string{".songs", ".stversions"}) FlagExcludeFiles = envvars.StringSlice("EXCLUDE_FILES", ":", []string{".songs", ".stversions"})
FlagUpdateCacheFileInterval = envvars.Duration("UPDATE_CACHE_FILE_INTERVAL", 10*time.Second) FlagUpdateCacheFileInterval = envvars.Duration("UPDATE_CACHE_FILE_INTERVAL", 10*time.Second)
FlagGroupMultipleFileChangesByTime = envvars.Duration("GROUP_FILE_CHANGES_INTERVAL", 10*time.Second)
) )
func main() { func main() {
@ -57,7 +58,7 @@ func main() {
return s 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 { if events == nil {
events = map[string]struct{}{} events = map[string]struct{}{}
} }