Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use runtime exception #1784

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpser

protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpsertServiceInterface<E, T> service, BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List<T> objectList, List<Long> idsAdded, Boolean terminateFailing, String countType, String dataType) {
if (Thread.currentThread().isInterrupted()) {
return false;
throw new RuntimeException("Thread isInterrupted");
}
ProcessDisplayHelper ph = new ProcessDisplayHelper();
ph.addDisplayHandler(loadProcessDisplayService);
Expand Down Expand Up @@ -259,9 +259,7 @@ protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpser
}
ph.progressProcess();
if (Thread.currentThread().isInterrupted()) {
history.setBulkloadStatus(JobStatus.FORCED_STOPPED);
Log.info("Thread Interrupted:");
break;
throw new RuntimeException("Thread isInterrupted");
}
}
updateHistory(history);
Expand All @@ -278,7 +276,7 @@ protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpser
// The following methods are for bulk validation
protected <S extends BaseEntityCrudService<?, ?>> void runCleanup(S service, BulkLoadFileHistory history, String dataProviderName, List<Long> annotationIdsBefore, List<Long> annotationIdsAfter, String loadTypeString, Boolean deprecate) {
if (Thread.currentThread().isInterrupted()) {
return;
throw new RuntimeException("Thread isInterrupted");
}
Log.debug("runLoad: After: " + dataProviderName + " " + annotationIdsAfter.size());

Expand Down Expand Up @@ -314,9 +312,7 @@ protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpser
}
ph.progressProcess();
if (Thread.currentThread().isInterrupted()) {
history.setBulkloadStatus(JobStatus.FORCED_STOPPED);
Log.info("Thread Interrupted:");
break;
throw new RuntimeException("Thread isInterrupted");
}
}
updateHistory(history);
Expand Down
Loading