Implement share worker #225

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-04-03 18:08:49 +02:00
parent 15d32016c6
commit 2e5840f3b0
18 changed files with 261 additions and 64 deletions

View File

@@ -10,6 +10,7 @@ import (
"time"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/photoprism"
"github.com/photoprism/photoprism/internal/server"
"github.com/photoprism/photoprism/pkg/fs"
"github.com/sevlyar/go-daemon"
@@ -115,11 +116,15 @@ func startAction(ctx *cli.Context) error {
// start web server
go server.Start(cctx, conf)
// start share & sync service workers
stop := photoprism.ServiceWorkers(conf)
// set up proper shutdown of daemon and web server
quit := make(chan os.Signal)
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
<-quit
stop <- true
log.Info("shutting down...")
conf.Shutdown()
cancel()