resources: Compare Delay and Retry metaparams on graph change

We forgot to add a number of important properties to the Compare. This
means that we'll rebuild elements for these changes too now.
This commit is contained in:
James Shubin
2016-09-20 05:35:04 -04:00
parent abe1ffaab6
commit 361d643ce7

View File

@@ -348,6 +348,13 @@ func (obj *BaseRes) SetGroup(g []Res) {
// Compare is the base compare method, which also handles the metaparams cmp
func (obj *BaseRes) Compare(res Res) bool {
// TODO: should the AutoEdge values be compared?
if obj.Meta().AutoEdge != res.Meta().AutoEdge {
return false
}
if obj.Meta().AutoGroup != res.Meta().AutoGroup {
return false
}
if obj.Meta().Noop != res.Meta().Noop {
// obj is the existing res, res is the *new* resource
// if we go from no-noop -> noop, we can re-use the obj
@@ -356,6 +363,12 @@ func (obj *BaseRes) Compare(res Res) bool {
return false // going from noop to no-noop!
}
}
if obj.Meta().Retry != res.Meta().Retry {
return false
}
if obj.Meta().Delay != res.Meta().Delay {
return false
}
return true
}