diff options
author | George Goldberg <george@gberg.me> | 2017-07-07 15:21:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-07 15:21:02 +0100 |
commit | 0495a519499d6cefa289982a94d8f42de541c1f0 (patch) | |
tree | 94b6145daa41ca4d1d4a172f030071076852a09a /model/config.go | |
parent | 6e0f5f096986dad11ef182ddb51d4bfb0e558860 (diff) | |
download | chat-0495a519499d6cefa289982a94d8f42de541c1f0.tar.gz chat-0495a519499d6cefa289982a94d8f42de541c1f0.tar.bz2 chat-0495a519499d6cefa289982a94d8f42de541c1f0.zip |
PLT-6916: Redesign the jobs package and Jobserver. (#6733)
This commit redesigns the jobserver to be based around an architecture
of "workers", which carry out jobs of a particular type, and "jobs"
which are a unit of work carried by a particular worker. It also
introduces "schedulers" which are responsible for scheduling jobs of a
particular type automatically (jobs can also be scheduled manually when
apropriate).
Workers may be run many times, either in instances of the platform
binary, or the standalone jobserver binary. In any mattermost cluster,
only one instance of platform OR jobserver must run the schedulers. At
the moment this is controlled by a config variable, but in future will
be controlled through the cluster leader election process.
Diffstat (limited to 'model/config.go')
-rw-r--r-- | model/config.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go index b7526925f..3e98aa8f6 100644 --- a/model/config.go +++ b/model/config.go @@ -436,6 +436,11 @@ type DataRetentionSettings struct { Enable *bool } +type JobSettings struct { + RunJobs *bool + RunScheduler *bool +} + type Config struct { ServiceSettings ServiceSettings TeamSettings TeamSettings @@ -462,6 +467,7 @@ type Config struct { WebrtcSettings WebrtcSettings ElasticSearchSettings ElasticSearchSettings DataRetentionSettings DataRetentionSettings + JobSettings JobSettings } func (o *Config) ToJson() string { @@ -1380,6 +1386,16 @@ func (o *Config) SetDefaults() { *o.DataRetentionSettings.Enable = false } + if o.JobSettings.RunJobs == nil { + o.JobSettings.RunJobs = new(bool) + *o.JobSettings.RunJobs = true + } + + if o.JobSettings.RunScheduler == nil { + o.JobSettings.RunScheduler = new(bool) + *o.JobSettings.RunScheduler = true + } + o.defaultWebrtcSettings() } |