chore: refactor param cache (#18377)

This commit is contained in:
andig 2025-01-23 16:16:21 +01:00 • committed by GitHub
parent 07fa1b64f8
commit 9e9c15ed58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 128 additions and 146 deletions

View file

@ -47,12 +47,12 @@ func NewScriptPluginFromConfig(other map[string]interface{}) (Plugin, error) {
return nil, err
}
p, err := NewScripPlugin(cc.Cmd, cc.Timeout, cc.Scale, cc.Cache)
p, err := NewScriptPlugin(cc.Cmd, cc.Timeout, cc.Scale, cc.Cache)
p.getter = defaultGetters(p, cc.Scale)
if err == nil {
var pipe *pipeline.Pipeline
pipe, err = pipeline.New(log, cc.Settings)
pipe, err = pipeline.New(p.log, cc.Settings)
p.pipeline = pipe
}
@ -61,7 +61,7 @@ func NewScriptPluginFromConfig(other map[string]interface{}) (Plugin, error) {
// NewScriptProvider creates a script plugin.
// Script execution is aborted after given timeout.
func NewScripPlugin(script string, timeout time.Duration, scale float64, cache time.Duration) (*Script, error) {
func NewScriptPlugin(script string, timeout time.Duration, scale float64, cache time.Duration) (*Script, error) {
if strings.TrimSpace(script) == "" {
return nil, errors.New("script is required")
}