fix speed regression due to missing goroutine in executer
Fixed speed regression introduced in dev due to missing go() statement when executing template input
@@ -39,15 +39,17 @@ func (e *Engine) ExecuteWithOpts(templatesList []*templates.Template, target Inp
}
wg.Add()
+ go func(tpl *templates.Template) {
switch {
- case template.SelfContained:
+ case tpl.SelfContained:
// Self Contained requests are executed here separately
- e.executeSelfContainedTemplateWithInput(template, results)
+ e.executeSelfContainedTemplateWithInput(tpl, results)
default:
// All other request types are executed here
- e.executeModelWithInput(templateType, template, target, results)
+ e.executeModelWithInput(templateType, tpl, target, results)
}
wg.Done()
+ }(template)
}
e.workPool.Wait()
return results
