Skip to content

Commit

Permalink
Merge branch 'master' into cancelTrigger
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry authored Oct 28, 2017
2 parents 126d947 + a0af1b1 commit 8aa5c88
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class FastPropertyCleanupListener implements ExecutionListener {
break
case PropertyAction.UPDATE.toString():
stage.context.originalProperties.each { Map originalProp ->
Map property = originalProp.property
Map property = originalProp.property ?: originalProp
Map updatedProperty = (Map) stage.context.persistedProperties.find { it.propertyId == property.propertyId }
String propertyId = property.propertyId
if (shouldRollback(updatedProperty)) {
Expand All @@ -84,8 +84,8 @@ class FastPropertyCleanupListener implements ExecutionListener {
}
break
case PropertyAction.DELETE.toString():
stage.context.originalProperties.each { Map prop ->
Map property = prop.property
stage.context.originalProperties.each { Map originalProp ->
Map property = originalProp.property ?: originalProp
if (propertyExists(property)) {
log.info("Property ${property.propertyId} exists, not restoring to original state after delete.")
} else {
Expand All @@ -94,7 +94,7 @@ class FastPropertyCleanupListener implements ExecutionListener {
}
log.info("Rolling back the delete of: ${property.key}|${property.value} on execution ${execution.id} by re-creating")

Response response = mahe.upsertProperty(prop)
Response response = mahe.upsertProperty(originalProp)
resolveRollbackResponse(response, stage.context.propertyAction.toString(), property)
}
}
Expand All @@ -111,7 +111,7 @@ class FastPropertyCleanupListener implements ExecutionListener {
Response propertyResponse = mahe.getPropertyById(propertyId, env)
Map currentProperty = mapper.readValue(propertyResponse.body.in().text, Map)
return currentProperty.property.ts == property.ts
}, 3, 2, false)
}, 3, 2000, false)
} catch (RetrofitError error) {
if (error.response.status == 404) {
return false
Expand Down

0 comments on commit 8aa5c88

Please sign in to comment.