MCPcopy Index your code
hub / github.com/netdata/netdata / resolveFunctionTimeout

Function resolveFunctionTimeout

src/go/cmd/godplugin/main.go:306–322  ·  view source on GitHub ↗
(flagValue string, payloadTimeout time.Duration)

Source from the content-addressed store, hash-verified

304}
305
306func resolveFunctionTimeout(flagValue string, payloadTimeout time.Duration) (time.Duration, error) {
307 if flagValue != "" {
308 d, err := time.ParseDuration(flagValue)
309 if err == nil {
310 return d, nil
311 }
312 secs, err2 := strconv.ParseInt(flagValue, 10, 64)
313 if err2 != nil {
314 return 0, fmt.Errorf("invalid function-timeout '%s'", flagValue)
315 }
316 return time.Duration(secs) * time.Second, nil
317 }
318 if payloadTimeout > 0 {
319 return payloadTimeout, nil
320 }
321 return time.Minute, nil
322}
323
324func loadConfigGroups(moduleName string, reg confgroup.Registry, collectors multipath.MultiPath) ([]*confgroup.Group, error) {
325 if path, err := collectors.Find(moduleName + ".conf"); err == nil && path != "" {

Callers 1

runFunctionCLIFunction · 0.85

Calls 2

ErrorfMethod · 0.65
DurationMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…