summaryrefslogtreecommitdiff
path: root/plugins/jobs/config.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-22 11:44:22 +0300
committerValery Piashchynski <[email protected]>2021-06-22 11:44:22 +0300
commit1a2a1f4735e40675abf6cd9767c99374359ec2bb (patch)
tree5abedf7306b50b02ba3892c0bc562307a62eb332 /plugins/jobs/config.go
parent260d69c21fba6d763d05dc5693689ddf7ce7bfe2 (diff)
- Remove all old code, reformat, fix linters, return GA
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/config.go')
-rw-r--r--plugins/jobs/config.go14
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")