summaryrefslogtreecommitdiffstats
path: root/jobs
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2018-09-26 12:42:51 -0400
committerGitHub <noreply@github.com>2018-09-26 12:42:51 -0400
commit4e59a27293394b6d5529efd13ad711daebbc0eb3 (patch)
tree51094fc76cfc6295d136e4ebbefbc3cac19c650a /jobs
parent15d64fb201848002a25facc3bbffc9535a704df6 (diff)
downloadchat-4e59a27293394b6d5529efd13ad711daebbc0eb3.tar.gz
chat-4e59a27293394b6d5529efd13ad711daebbc0eb3.tar.bz2
chat-4e59a27293394b6d5529efd13ad711daebbc0eb3.zip
Move HTTPService and ConfigService into services package (#9422)
* Move HTTPService and ConfigService into utils package * Re-add StaticConfigService * Move config and http services into their own packages
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