atc: dont update if already nil
Previously, we were updating the check error to nil even if it already
nil. This change will make it so that we will only update the value to
nil if it is not already nil.
@@ -263,7 +263,10 @@ func (r *resource) SetCheckSetupError(cause error) error {
if cause == nil {
_, err = psql.Update("resources").
Set("check_error", nil).
- Where(sq.Eq{"id": r.ID()}).
+ Where(sq.And{
+ sq.Eq{"id": r.ID()},
+ sq.NotEq{"check_error": nil},
+ }).
RunWith(r.conn).
Exec()
} else {
