From d9d4179439b978da7e58f1b7458ace38f29d62c1 Mon Sep 17 00:00:00 2001 From: nkumar2 Date: Mon, 22 Jan 2024 03:12:31 +0000 Subject: [PATCH] fix scheduler timing --- .../ac/ebi/eva/contigalias/scheduler/ChecksumSetter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/uk/ac/ebi/eva/contigalias/scheduler/ChecksumSetter.java b/src/main/java/uk/ac/ebi/eva/contigalias/scheduler/ChecksumSetter.java index d0b4cdf5..3b151551 100644 --- a/src/main/java/uk/ac/ebi/eva/contigalias/scheduler/ChecksumSetter.java +++ b/src/main/java/uk/ac/ebi/eva/contigalias/scheduler/ChecksumSetter.java @@ -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 assemblyList = chromosomeService.getAssembliesWhereChromosomeMd5ChecksumIsNull(); @@ -90,10 +88,14 @@ public void updateMD5ChecksumForAllChromosomesInAssembly(String assembly) { logger.info("Trying to update md5checksum for assembly: " + assembly); Slice chrSlice; Pageable pageable = PageRequest.of(0, DEFAULT_PAGE_SIZE); + long chromosomeUpdated = 0; do { chrSlice = chromosomeService.getChromosomesByAssemblyInsdcAccessionWhereMd5ChecksumIsNull(assembly, pageable); List 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");