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:
13
resources.go
13
resources.go
@@ -348,6 +348,13 @@ func (obj *BaseRes) SetGroup(g []Res) {
|
|||||||
|
|
||||||
// Compare is the base compare method, which also handles the metaparams cmp
|
// Compare is the base compare method, which also handles the metaparams cmp
|
||||||
func (obj *BaseRes) Compare(res Res) bool {
|
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 {
|
if obj.Meta().Noop != res.Meta().Noop {
|
||||||
// obj is the existing res, res is the *new* resource
|
// obj is the existing res, res is the *new* resource
|
||||||
// if we go from no-noop -> noop, we can re-use the obj
|
// 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!
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user