Skip to content

Commit

Permalink
add validation for job_gc_interval (#6277)
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzyfresh committed Sep 5, 2019
1 parent 97150f9 commit 50c515a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion command/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ func convertServerConfig(agentConfig *Config) (*nomad.Config, error) {
if gcInterval := agentConfig.Server.JobGCInterval; gcInterval != "" {
dur, err := time.ParseDuration(gcInterval)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to parse job_gc_interval: %v", err)
} else if dur <= time.Duration(0) {
return nil, fmt.Errorf("job_gc_interval should be greater than 0s")
}
conf.JobGCInterval = dur
}
Expand Down

0 comments on commit 50c515a

Please sign in to comment.