diff options
author | Valery Piashchynski <[email protected]> | 2021-07-12 08:47:33 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-12 08:47:33 +0300 |
commit | e82e9248bb1afd5e571f465ac79ac7f5f79b81f1 (patch) | |
tree | 098a9827f51255916f99160b02098153f8d0238e /plugins/jobs/pipeline | |
parent | 0f70f1e2311640236d74a0a237536779d8d44223 (diff) |
Finish dynamic declaration of the pipelines. Fix issue with
configuration parsing in the AMQP consumer.
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/pipeline')
-rw-r--r-- | plugins/jobs/pipeline/pipeline.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/jobs/pipeline/pipeline.go b/plugins/jobs/pipeline/pipeline.go index e87204f9..91898178 100644 --- a/plugins/jobs/pipeline/pipeline.go +++ b/plugins/jobs/pipeline/pipeline.go @@ -44,6 +44,17 @@ func (p Pipeline) String(name string, d string) string { return d } +// Int must return option value as string or return default value. +func (p Pipeline) Int(name string, d int) int { + if value, ok := p[name]; ok { + if i, ok := value.(int); ok { + return i + } + } + + return d +} + // Priority returns default pipeline priority func (p Pipeline) Priority() uint64 { if value, ok := p[priority]; ok { |