Skip to content

Commit

Permalink
fix(cfn): Return RUNNING if an error occurred (#3210)
Browse files Browse the repository at this point in the history
* fix(cfn): Return RUNNING if an error occurred

Force cache refreshing was a retryable task. However, it didn't return
RUNNING whenever the cache refresh failed, and thus the task failed
immediately. This patch makes the task return RUNNING whenever there's
an exception refreshing the cache so it actually retries.
  • Loading branch information
xavileon authored and marchello2000 committed Oct 3, 2019
1 parent 0d64a4f commit 109c3b2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import javax.annotation.Nonnull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import retrofit.RetrofitError;

@Component
public class CloudFormationForceCacheRefreshTask extends AbstractCloudProviderAwareTask
Expand Down Expand Up @@ -60,8 +61,11 @@ public TaskResult execute(@Nonnull Stage stage) {
data.put("stackName", stackName);
}

cacheService.forceCacheUpdate(cloudProvider, REFRESH_TYPE, data);

try {
cacheService.forceCacheUpdate(cloudProvider, REFRESH_TYPE, data);
} catch (RetrofitError e) {
return TaskResult.RUNNING;
}
return TaskResult.SUCCEEDED;
}

Expand Down

0 comments on commit 109c3b2

Please sign in to comment.