diff --git a/PKGBUILD b/PKGBUILD --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Misti pkgname=compressor-git -pkgver=r22.43d7421 +pkgver=r23.6ef9b20 pkgrel=1 pkgdesc="Video compressor service that watches input directory and compresses videos using ffmpeg" arch=('x86_64' 'aarch64') diff --git a/cmd/compressor/main.go b/cmd/compressor/main.go --- a/cmd/compressor/main.go +++ b/cmd/compressor/main.go @@ -14,7 +14,7 @@ "github.com/fsnotify/fsnotify" ) -var processed sync.Map // track recently processed files to prevent loops +var processed sync.Map // track recently handled files to prevent loops func main() { cfg, err := loadConfig() @@ -95,7 +95,7 @@ enqueue := func(path string) { if !shouldProcess(cfg, path) { return } - // Skip if recently processed to prevent loops + // Skip if recently handled (processed or intentionally skipped) to prevent loops if _, ok := processed.Load(path); ok { return } diff --git a/cmd/compressor/processor.go b/cmd/compressor/processor.go --- a/cmd/compressor/processor.go +++ b/cmd/compressor/processor.go @@ -38,6 +38,7 @@ outputPath, err := buildOutputPath(cfg, originalPath) if err != nil { if errors.Is(err, os.ErrExist) { log.Printf("skip %s: output already exists: %v", originalPath, err) + processed.Store(originalPath, time.Now()) return nil } sendDiscordFailure(cfg.discordWebhookURL, originalPath, fmt.Sprintf("build output path: %v", err))