Always merge with default reschedule policy if its not nil

This commit is contained in:
Preetha Appan 2018-04-11 15:26:01 -05:00
parent a7b7b662ed
commit ae1419826e
No known key found for this signature in database
GPG Key ID: 9F7C19990A50EAFC
1 changed files with 4 additions and 1 deletions

View File

@ -103,6 +103,9 @@ type ReschedulePolicy struct {
}
func (r *ReschedulePolicy) Merge(rp *ReschedulePolicy) {
if rp == nil {
return
}
if rp.Interval != nil {
r.Interval = rp.Interval
}
@ -432,7 +435,7 @@ func (g *TaskGroup) Canonicalize(job *Job) {
}
}
if defaultReschedulePolicy != nil && g.ReschedulePolicy != nil {
if defaultReschedulePolicy != nil {
defaultReschedulePolicy.Merge(g.ReschedulePolicy)
g.ReschedulePolicy = defaultReschedulePolicy
}