From 361d643ce7f7cd62ef6c733f0ac614b729beb6f8 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Tue, 20 Sep 2016 05:35:04 -0400 Subject: [PATCH] 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. --- resources.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources.go b/resources.go index 27aa07ca..667762f5 100644 --- a/resources.go +++ b/resources.go @@ -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 }