diff options
Diffstat (limited to 'plugins/jobs/drivers/sqs/consumer.go')
-rw-r--r-- | plugins/jobs/drivers/sqs/consumer.go | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/plugins/jobs/drivers/sqs/consumer.go b/plugins/jobs/drivers/sqs/consumer.go index 5d419b51..17af1caa 100644 --- a/plugins/jobs/drivers/sqs/consumer.go +++ b/plugins/jobs/drivers/sqs/consumer.go @@ -160,30 +160,16 @@ func FromPipeline(pipe *pipeline.Pipeline, log logger.Logger, cfg cfgPlugin.Conf globalCfg.InitDefault() - res := make(map[string]interface{}) - pipe.Map(attributes, res) - attr := make(map[string]string) - // accept only string values - for i := range res { - if v, ok := res[i].(string); ok { - attr[i] = v - } - } - - // delete all values with map.clear to reuse for the tags - for k := range res { - delete(res, k) + err = pipe.Map(attributes, attr) + if err != nil { + return nil, errors.E(op, err) } - pipe.Map(tags, res) - tg := make(map[string]string) - // accept only string values - for i := range res { - if v, ok := res[i].(string); ok { - attr[i] = v - } + err = pipe.Map(tags, tg) + if err != nil { + return nil, errors.E(op, err) } // initialize job consumer |