Skip to content

Commit d550590

Browse files
committed
DS-2381: Only retry sync queries.
Signed-off-by: mchrza <maximilian.chrzan@here.com>
1 parent bc04a29 commit d550590

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

xyz-jobs/xyz-job-steps/src/main/java/com/here/xyz/jobs/steps/execution/db/DatabaseBasedStep.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ private Object executeQuery(SQLQuery query, Database db, double estimatedMaxAcuL
143143
else if (query.getTimeout() == Integer.MAX_VALUE)
144144
query.setTimeout(300);
145145

146-
//add retry settings
147-
query.withRetryableErrorCodesAndMaximumRetries(RETRYABLE_SQL_CODES, MAXIMUM_RETRIES);
148-
149146
Object result;
150147
if (query.isBatch() && isWriteQuery)
151148
result = query.writeBatch(requestResource(db, estimatedMaxAcuLoad));
@@ -156,6 +153,9 @@ else if (query.getTimeout() == Integer.MAX_VALUE)
156153

157154
if (async)
158155
runningQueries.add(new RunningQuery(query.getQueryId(), db.getName(), db.getId()));
156+
else
157+
//add retry settings
158+
query.withRetryableErrorCodesAndMaximumRetries(RETRYABLE_SQL_CODES, MAXIMUM_RETRIES);
159159

160160
return result;
161161
}

0 commit comments

Comments
 (0)