aboutsummaryrefslogtreecommitdiff
path: root/cmd/server/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/server/main.go')
-rw-r--r--cmd/server/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 375a26c..59ea957 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -90,14 +90,14 @@ func main() {
exifScanner = worker.NewEXIFScanner(root, mediaRepository)
)
- ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
- defer stop()
-
pool := worker.NewWorkerPool()
pool.AddWorker("http server", serverWorker)
pool.AddWorker("exif scanner", worker.NewWorkerFromListProcessor[*media.Media](exifScanner, scheduler))
pool.AddWorker("file scanner", worker.NewWorkerFromChanProcessor[string](fileScanner, scheduler))
+ ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
+ defer stop()
+
pool.Start(ctx)
pool.Wait()
}