summaryrefslogtreecommitdiffstats
path: root/jobs/workers.go
diff options
context:
space:
mode:
Diffstat (limited to 'jobs/workers.go')
-rw-r--r--jobs/workers.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/jobs/workers.go b/jobs/workers.go
index 57a255013..67ab43241 100644
--- a/jobs/workers.go
+++ b/jobs/workers.go
@@ -20,6 +20,7 @@ type Workers struct {
ElasticsearchIndexing model.Worker
ElasticsearchAggregation model.Worker
LdapSync model.Worker
+ Migrations model.Worker
listenerId string
}
@@ -50,6 +51,10 @@ func (srv *JobServer) InitWorkers() *Workers {
workers.LdapSync = ldapSyncInterface.MakeWorker()
}
+ if migrationsInterface := srv.Migrations; migrationsInterface != nil {
+ workers.Migrations = migrationsInterface.MakeWorker()
+ }
+
return workers
}
@@ -77,6 +82,10 @@ func (workers *Workers) Start() *Workers {
go workers.LdapSync.Run()
}
+ if workers.Migrations != nil {
+ go workers.Migrations.Run()
+ }
+
go workers.Watcher.Start()
})
@@ -152,6 +161,10 @@ func (workers *Workers) Stop() *Workers {
workers.LdapSync.Stop()
}
+ if workers.Migrations != nil {
+ workers.Migrations.Stop()
+ }
+
mlog.Info("Stopped workers")
return workers