syncthing debug

This commit is contained in:
Tordarus 2025-01-16 12:57:36 +01:00
parent 6f6dfc90b2
commit 715433d748
2 changed files with 8 additions and 1 deletions

View File

@ -20,7 +20,7 @@ var ( // flags
FlagSourceDir = envvars.String("SOURCE_PATH", "/video") FlagSourceDir = envvars.String("SOURCE_PATH", "/video")
FlagTargetDir = envvars.String("TARGET_PATH", "/audio") FlagTargetDir = envvars.String("TARGET_PATH", "/audio")
FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin") FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin")
FlagExcludeFiles = envvars.StringSlice("EXCLUDE_FILES", ":", []string{".songs"}) 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)
) )
@ -68,6 +68,11 @@ func main() {
filesByGroup := channel.FlatMap(groupedFiles, func(key string, _ struct{}) string { return key }) filesByGroup := channel.FlatMap(groupedFiles, func(key string, _ struct{}) string { return key })
filteredFiles := channel.Filter(filesByGroup, Or(Not(Exists), And(SymlinkFilesOnly, VideosOnly))) filteredFiles := channel.Filter(filesByGroup, Or(Not(Exists), And(SymlinkFilesOnly, VideosOnly)))
filteredFiles = channel.MapSuccessive(filteredFiles, func(s string) string {
fmt.Println("DEBUG", s)
return s
})
for file := range filteredFiles { for file := range filteredFiles {
if err := TranscodeFile(file); err != nil { if err := TranscodeFile(file); err != nil {
fmt.Fprintln(os.Stderr, fmt.Errorf("could not transcode file '%s': %w", file, err)) fmt.Fprintln(os.Stderr, fmt.Errorf("could not transcode file '%s': %w", file, err))

View File

@ -63,6 +63,8 @@ func WatchDirectory(ctx context.Context, path string, op ...fsnotify.Op) (<-chan
} }
} }
fmt.Println("DEBUG", "done providing existing files")
for { for {
select { select {
case event, ok := <-watcher.Events: case event, ok := <-watcher.Events: