Skip to content

Commit 608ff7b

Browse files
committed
Adjust retry configuration
1 parent 7525cf4 commit 608ff7b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/org/hibernate/infra/replicate/jira/service/jira/client/JiraRestClientBuilder.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ public JiraIssueBulkResponse create(JiraIssueBulk bulk) {
154154

155155
@Override
156156
public JiraIssueResponse update(String key, JiraIssue issue) {
157-
return withRetry(() -> delegate.update(key, issue));
157+
// it might be that mapped user is wrong so we don't want to keep sending it
158+
return withRetry( () -> delegate.update( key, issue ), 2 );
158159
}
159160

160161
@Override
@@ -258,8 +259,12 @@ private void withRetry(Runnable runnable) {
258259
}
259260

260261
private <T> T withRetry(Supplier<T> supplier) {
262+
return withRetry( supplier, RETRIES );
263+
}
264+
265+
private <T> T withRetry(Supplier<T> supplier, int retries) {
261266
RuntimeException e = null;
262-
for (int i = 0; i < RETRIES; i++) {
267+
for (int i = 0; i < retries; i++) {
263268
try {
264269
return supplier.get();
265270
} catch (RuntimeException exception) {

0 commit comments

Comments
 (0)