From 6c03f247e8d2137ad41a1587d985490426237822 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Thu, 15 Jun 2023 12:53:53 +0200 Subject: [PATCH] Fail immediately when project metadata cannot be updated. Remove loop that puts additional pressure on target system. Closes: #49 --- .../ProjectServiceOperations.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/springframework/data/release/projectservice/ProjectServiceOperations.java b/src/main/java/org/springframework/data/release/projectservice/ProjectServiceOperations.java index 3e7b2f3..79c44fc 100644 --- a/src/main/java/org/springframework/data/release/projectservice/ProjectServiceOperations.java +++ b/src/main/java/org/springframework/data/release/projectservice/ProjectServiceOperations.java @@ -89,21 +89,8 @@ class ProjectServiceOperations { // Sometimes we see 404 Not Found: [no body], sometimes // 400 Bad Request: "Release '2.2.13-SNAPSHOT' already present - RuntimeException rethrow = null; - for (int i = 0; i < 5; i++) { - - try { - client.updateProjectMetadata(entry.getKey(), entry.getValue()); - return; - } catch (RuntimeException e) { - rethrow = e; - logger.warn(entry.getKey(), e.toString()); - } - } - - if (rethrow != null) { - throw rethrow; - } + // still we should fail here and report those failures to the website team + client.updateProjectMetadata(entry.getKey(), entry.getValue()); }); }