mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -38,7 +38,9 @@ import (
|
||||
var log = event.Log
|
||||
var stop = make(chan bool, 1)
|
||||
|
||||
// Start starts the execution of background workers and scheduled tasks based on the current configuration.
|
||||
// Start launches background workers and scheduled tasks based on the current
|
||||
// configuration. It sets up the cron scheduler and the periodic metadata/share
|
||||
// workers.
|
||||
func Start(conf *config.Config) {
|
||||
if scheduler, err := gocron.NewScheduler(gocron.WithLocation(conf.DefaultTimezone())); err != nil {
|
||||
log.Errorf("scheduler: %s (start)", err)
|
||||
@@ -56,6 +58,11 @@ func Start(conf *config.Config) {
|
||||
log.Errorf("scheduler: %s (index)", err)
|
||||
}
|
||||
|
||||
// Schedule vision job.
|
||||
if err = NewJob("vision", conf.VisionSchedule(), NewVision(conf).StartScheduled); err != nil {
|
||||
log.Errorf("scheduler: %s (vision)", err)
|
||||
}
|
||||
|
||||
// Start the scheduler.
|
||||
Scheduler.Start()
|
||||
}
|
||||
@@ -89,7 +96,7 @@ func Start(conf *config.Config) {
|
||||
}()
|
||||
}
|
||||
|
||||
// Shutdown stops the background workers and scheduled tasks.
|
||||
// Shutdown stops the background workers and shuts down the scheduler.
|
||||
func Shutdown() {
|
||||
log.Info("shutting down workers")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user