Skip to content

Commit

Permalink
fix scheduler timing
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-ebi committed Jan 22, 2024
1 parent f0ec9c2 commit d9d4179
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public ChecksumSetter(ChromosomeService chromosomeService, Md5ChecksumRetriever
this.md5ChecksumRetriever = md5ChecksumRetriever;
}

// @Scheduled(cron = "30 15 10 1 * ? 2023") -- the task to run at 10:15:30 AM on the 1st day of every month in the year 2023.
//Seconds: 30 Minutes: 15 Hours: 10 Day of the month: 1 Month: Every month Day of the week: Every day of the week Year: 2023
@Scheduled(initialDelay = 24 * 60 * 60 * 1000, fixedDelay = 24 * 60 * 60 * 1000)
@Scheduled(cron = "0 0 0 ? * FRI")
public void updateMd5CheckSumForAllAssemblies() {
scheduledToRunMD5ChecksumUpdateTasks = new HashSet<>();
List<String> assemblyList = chromosomeService.getAssembliesWhereChromosomeMd5ChecksumIsNull();
Expand Down Expand Up @@ -90,10 +88,14 @@ public void updateMD5ChecksumForAllChromosomesInAssembly(String assembly) {
logger.info("Trying to update md5checksum for assembly: " + assembly);
Slice<ChromosomeEntity> chrSlice;
Pageable pageable = PageRequest.of(0, DEFAULT_PAGE_SIZE);
long chromosomeUpdated = 0;
do {
chrSlice = chromosomeService.getChromosomesByAssemblyInsdcAccessionWhereMd5ChecksumIsNull(assembly, pageable);
List<ChromosomeEntity> chromosomeEntityList = chrSlice.getContent();
updateMd5ChecksumForChromosome(chromosomeEntityList);

chromosomeUpdated += chromosomeEntityList.size();
logger.info("Chromosomes Updated till now: " + chromosomeUpdated);
} while (chrSlice.hasNext());

logger.info("Updating md5checksum for assembly " + assembly + " completed");
Expand Down

0 comments on commit d9d4179

Please sign in to comment.