use parseutil.ParseDurationSecond(...) which allows a value without a suffix to be treated as seconds instead of nanoseconds (#1447)
This commit is contained in:
1 file changed
+1
-1
@@ -476,7 +476,7 @@ func parseEventing(eventObj *ast.ObjectItem) (*event.EventerConfig, error) {
|
||||
// parse the duration string specified in a file config into a time.Duration
|
||||
if s.FileConfig != nil && s.FileConfig.RotateDurationHCL != "" {
|
||||
var err error
|
||||
s.FileConfig.RotateDuration, err = time.ParseDuration(s.FileConfig.RotateDurationHCL)
|
||||
s.FileConfig.RotateDuration, err = parseutil.ParseDurationSecond(s.FileConfig.RotateDurationHCL)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't parse rotation duration %s", s.FileConfig.RotateDurationHCL)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user