From 2952f687207f3fc66e9f20bef6ae1f7e8f4e3d1a Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 29 May 2024 16:49:05 +0200 Subject: [PATCH] fix(config): handles raw nanoseconds durations --- internal/config/environment.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/config/environment.go b/internal/config/environment.go index 437b78f..baccdd7 100644 --- a/internal/config/environment.go +++ b/internal/config/environment.go @@ -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)