Skip to content

Commit

Permalink
use parseutil.ParseDurationSecond(...) which allows a value without a…
Browse files Browse the repository at this point in the history
… suffix to be treated as seconds instead of nanoseconds (#1447)
  • Loading branch information
jimlambrt authored Aug 4, 2021
1 parent acc3dda commit 00cb18e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 00cb18e

Please sign in to comment.