diff options
Diffstat (limited to 'plugins/jobs/config.go')
-rw-r--r-- | plugins/jobs/config.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/jobs/config.go b/plugins/jobs/config.go index 5c5ad400..4606ccba 100644 --- a/plugins/jobs/config.go +++ b/plugins/jobs/config.go @@ -8,8 +8,8 @@ import ( // Config defines settings for job broker, workers and job-pipeline mapping. type Config struct { // Workers configures roadrunner server and worker busy. - //Workers *roadrunner.ServerConfig - pool poolImpl.Config + // Workers *roadrunner.ServerConfig + poolCfg poolImpl.Config // Dispatch defines where and how to match jobs. Dispatch map[string]*Options @@ -25,6 +25,16 @@ type Config struct { route Dispatcher } +func (c *Config) InitDefaults() error { + const op = errors.Op("config_init_defaults") + var err error + c.pipelines, err = initPipelines(c.Pipelines) + if err != nil { + return errors.E(op, err) + } + return nil +} + // MatchPipeline locates the pipeline associated with the job. func (c *Config) MatchPipeline(job *Job) (*Pipeline, *Options, error) { const op = errors.Op("config_match_pipeline") |