summaryrefslogtreecommitdiffstats
path: root/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'jobs')
-rw-r--r--jobs/server.go19
-rw-r--r--jobs/workers.go3
2 files changed, 5 insertions, 17 deletions
diff --git a/jobs/server.go b/jobs/server.go
index cffc60da1..80c48a165 100644
--- a/jobs/server.go
+++ b/jobs/server.go
@@ -7,25 +7,12 @@ import (
ejobs "github.com/mattermost/mattermost-server/einterfaces/jobs"
tjobs "github.com/mattermost/mattermost-server/jobs/interfaces"
"github.com/mattermost/mattermost-server/model"
+ "github.com/mattermost/mattermost-server/services/configservice"
"github.com/mattermost/mattermost-server/store"
)
-type ConfigService interface {
- Config() *model.Config
- AddConfigListener(func(old, current *model.Config)) string
- RemoveConfigListener(string)
-}
-
-type StaticConfigService struct {
- Cfg *model.Config
-}
-
-func (s StaticConfigService) Config() *model.Config { return s.Cfg }
-func (StaticConfigService) AddConfigListener(func(old, current *model.Config)) string { return "" }
-func (StaticConfigService) RemoveConfigListener(string) {}
-
type JobServer struct {
- ConfigService ConfigService
+ ConfigService configservice.ConfigService
Store store.Store
Workers *Workers
Schedulers *Schedulers
@@ -38,7 +25,7 @@ type JobServer struct {
Migrations tjobs.MigrationsJobInterface
}
-func NewJobServer(configService ConfigService, store store.Store) *JobServer {
+func NewJobServer(configService configservice.ConfigService, store store.Store) *JobServer {
return &JobServer{
ConfigService: configService,
Store: store,
diff --git a/jobs/workers.go b/jobs/workers.go
index 9909e035c..ad457ed2a 100644
--- a/jobs/workers.go
+++ b/jobs/workers.go
@@ -8,11 +8,12 @@ import (
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
+ "github.com/mattermost/mattermost-server/services/configservice"
)
type Workers struct {
startOnce sync.Once
- ConfigService ConfigService
+ ConfigService configservice.ConfigService
Watcher *Watcher
DataRetention model.Worker