fix(config): handles raw nanoseconds durations
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
parent
3e98901931
commit
2952f68720
@ -206,7 +206,12 @@ func (id *InterpolatedDuration) UnmarshalYAML(value *yaml.Node) error {
|
||||
|
||||
duration, err := time.ParseDuration(str)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "could not parse duration '%v', line '%d'", str, value.Line)
|
||||
nanoseconds, err := strconv.ParseInt(str, 10, 64)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "could not parse duration '%v', line '%d'", str, value.Line)
|
||||
}
|
||||
|
||||
duration = time.Duration(nanoseconds)
|
||||
}
|
||||
|
||||
*id = InterpolatedDuration(duration)
|
||||
|
Loading…
Reference in New Issue
Block a user