Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
arcshiftsolutions committed Nov 23, 2023
1 parent d667a7e commit 18034bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public ResponseEntity<String> moveSchool(MoveSchoolData moveSchoolData) {
public OnboardingFileProcessResponse processOnboardingFile(OnboardingFileUpload fileUpload) {
List<SagaEntity> sagaEntities = this.edxFileOnboardingService.processOnboardingFile(Base64.getDecoder().decode(fileUpload.getFileContents()), fileUpload.getCreateUser());
log.info("Number of onboarded sagas stored is: " + sagaEntities.size());
List<SagaEntity> first10Sagas = sagaEntities.stream().limit(10).toList();
first10Sagas.forEach(sagaEntity -> startServicesSaga(sagaEntity.getSagaName().equals(ONBOARD_SCHOOL_USER_SAGA.toString()) ? ONBOARD_SCHOOL_USER_SAGA : ONBOARD_DISTRICT_USER_SAGA, sagaEntity));
List<SagaEntity> first100Sagas = sagaEntities.stream().limit(100).toList();
first100Sagas.forEach(sagaEntity -> startServicesSaga(sagaEntity.getSagaName().equals(ONBOARD_SCHOOL_USER_SAGA.toString()) ? ONBOARD_SCHOOL_USER_SAGA : ONBOARD_DISTRICT_USER_SAGA, sagaEntity));
OnboardingFileProcessResponse response = new OnboardingFileProcessResponse();
response.setProcessedCount(Integer.toString(sagaEntities.size()));
return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface SagaRepository extends JpaRepository<SagaEntity, UUID> {
* @param statuses the statuses
* @return the list
*/
List<SagaEntity> findTop10ByStatusInOrderByCreateDate(List<String> statuses);
List<SagaEntity> findTop100ByStatusInOrderByCreateDate(List<String> statuses);

/**
* Find all by create date before list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public EventTaskScheduler(final SagaRepository sagaRepository, final List<Orches
@SchedulerLock(name = "EXTRACT_UNCOMPLETED_SAGAS",
lockAtLeastFor = "${scheduled.jobs.extract.uncompleted.sagas.cron.lockAtLeastFor}", lockAtMostFor = "${scheduled.jobs.extract.uncompleted.sagas.cron.lockAtMostFor}")
public void findAndProcessUncompletedSagas() {
final List<SagaEntity> sagas = this.getSagaRepository().findTop10ByStatusInOrderByCreateDate(this.getStatusFilters());
final List<SagaEntity> sagas = this.getSagaRepository().findTop100ByStatusInOrderByCreateDate(this.getStatusFilters());
if (!sagas.isEmpty()) {
this.processUncompletedSagas(sagas);
}
Expand Down

0 comments on commit 18034bc

Please sign in to comment.