Skip to content

Commit

Permalink
#2502 : removing datasetServiceImpl self invoc (ignoring transaction …
Browse files Browse the repository at this point in the history
…self invoc warning)
  • Loading branch information
DuckflipXYZ committed Jan 21, 2025
1 parent 5d9ea5a commit cc4c329
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ public class DatasetServiceImpl implements DatasetService {
@Autowired
DatasetExpressionRepository datasetExpressionRepository;

@Autowired
@Lazy
private DatasetServiceImpl datasetServiceImpl;

private static final Logger LOG = LoggerFactory.getLogger(DatasetServiceImpl.class);

@Override
Expand Down Expand Up @@ -391,13 +387,13 @@ public void deleteNiftis(Long studyId) {
shanoirEventService.publishEvent(event);
try {
int total = datasets.size();
datasetServiceImpl.updateEvent(0f, event, studyId);
updateEvent(0f, event, studyId);
for (List<Long> partition : ListUtils.partition(datasets, 1000)){
datasetServiceImpl.deletePartitionOfNiftis(partition, total, event).get();
deletePartitionOfNiftis(partition, total, event).get();
}
datasetServiceImpl.updateEvent(1f, event, studyId);
updateEvent(1f, event, studyId);
} catch (Exception e) {
datasetServiceImpl.updateEvent(-1f, event, studyId, e);
updateEvent(-1f, event, studyId, e);

}
}
Expand All @@ -415,11 +411,11 @@ protected Future<Void> deletePartitionOfNiftis(List<Long> partition, float total
}

protected void updateEvent(float progress, ShanoirEvent event) {
datasetServiceImpl.updateEvent(progress, event, null, null);
updateEvent(progress, event, null, null);
}

protected void updateEvent(float progress, ShanoirEvent event, Long id) {
datasetServiceImpl.updateEvent(progress, event, id, null);
updateEvent(progress, event, id, null);
}

@Transactional(propagation = Propagation.REQUIRES_NEW)
Expand Down

0 comments on commit cc4c329

Please sign in to comment.