diff --git a/PKGBUILD b/PKGBUILD index 9e6ceab..1b109ce 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Misti pkgname=compressor-git -pkgver=r15.acc0888 +pkgver=r16.0a9cb23 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 index f0f53ce..b23acda 100644 --- a/cmd/compressor/main.go +++ b/cmd/compressor/main.go @@ -123,7 +123,9 @@ func main() { log.Fatalf("watch dir: %v", err) } + wg.Add(1) go func() { + defer wg.Done() for { select { case <-ctx.Done(): @@ -144,7 +146,9 @@ func main() { } }() + wg.Add(1) go func() { + defer wg.Done() ticker := time.NewTicker(cfg.rescanInterval) defer ticker.Stop() for { @@ -161,14 +165,18 @@ func main() { serverErrs := make(chan error, 1) if cfg.httpPort != "" { + wg.Add(1) go func() { + defer wg.Done() serverErrs <- runHTTPServer(ctx, cfg.httpPort) }() } else { close(serverErrs) } + log.Println("Startup Done") <-ctx.Done() + log.Println("Shutting down...") dispatcherCancel() wg.Wait()