Skip to content

Commit d060733

Browse files
committed
Ticket 6505 | Pick all errorRecords in intial repo call for processing for retry
1 parent a9ebc24 commit d060733

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

goonj/src/main/java/org/avni_integration_service/goonj/job/AvniGoonjFullErrorJob.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void execute(GoonjConfig goonjConfig) {
4949
bugsnag.notify(e);
5050
} finally {
5151
try {
52-
errorRecordsWorker.evaluateNewErrors();
52+
errorRecordsWorker.evaluateNewErrors(); //ignoring response on purpose
5353
} catch (Exception e) {
5454
logger.error("Failed to evaluate new errors", e);
5555
bugsnag.notify(e);

goonj/src/main/java/org/avni_integration_service/goonj/worker/AvniGoonjErrorRecordsWorker.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class AvniGoonjErrorRecordsWorker {
5858

5959
private static final Logger logger = Logger.getLogger(AvniGoonjErrorRecordsWorker.class);
6060

61-
private static final int pageSize = 20;
61+
private static final int pageSize = 1000;
6262

6363
public void process(SyncDirection syncDirection, boolean allErrors) throws Exception {
6464
Page<ErrorRecord> errorRecordPage;
@@ -74,8 +74,7 @@ else if (syncDirection.equals(SyncDirection.GoonjToAvni) && !allErrors)
7474
errorRecordPage = errorRecordRepository.findAllByIntegratingEntityTypeNotNullAndProcessingDisabledFalseAndErrorRecordLogsErrorTypeNotInAndIntegrationSystemIdOrderById(
7575
avniGoonjErrorService.getUnprocessableErrorTypes(), integrationSystemId, pageRequest);
7676
else if (syncDirection.equals(SyncDirection.GoonjToAvni) && allErrors)
77-
errorRecordPage = errorRecordRepository.findAllByIntegratingEntityTypeNotNullAndErrorRecordLogsErrorTypeNotInAndIntegrationSystemIdOrderById(
78-
avniGoonjErrorService.getUnprocessableErrorTypes(), integrationSystemId, pageRequest);
77+
errorRecordPage = errorRecordRepository.findAllByIntegratingEntityTypeNotNullAndIntegrationSystemIdOrderById(integrationSystemId, pageRequest);
7978
else {
8079
throw new RuntimeException("Invalid arguments");
8180
}

integration-data/src/main/java/org/avni_integration_service/integration_data/repository/ErrorRecordRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public interface ErrorRecordRepository extends PagingAndSortingRepository<ErrorR
2626
Page<ErrorRecord> findAllByIntegratingEntityTypeNotNullAndProcessingDisabledFalseAndErrorRecordLogsErrorTypeNotInAndIntegrationSystemIdOrderById(List<ErrorType> errorTypes, int integrationSystemId, Pageable pageable);
2727
Page<ErrorRecord> findAllByIntegratingEntityTypeNotNullAndErrorRecordLogsErrorTypeNotInAndIntegrationSystemOrderById(List<ErrorType> errorTypes, IntegrationSystem integrationSystem, Pageable pageable);
2828
Page<ErrorRecord> findAllByIntegratingEntityTypeNotNullAndErrorRecordLogsErrorTypeNotInAndIntegrationSystemIdOrderById(List<ErrorType> errorTypes, int integrationSystemId, Pageable pageable);
29+
Page<ErrorRecord> findAllByIntegratingEntityTypeNotNullAndIntegrationSystemIdOrderById(int integrationSystemId, Pageable pageable);
2930

3031
List<ErrorRecord> findAllByAvniEntityTypeNotNull();
3132

0 commit comments

Comments
 (0)