79804050

Date: 2025-10-29 17:01:49
Score: 1.5
Natty:
Report link

@ tibortru answer works. I had a requirement where the requirement was to run scheduled spring batch job a lot more often in the test environments. I achieved this like so in the application-test.yml

batch
  scheduler:
    cron: 0 ${random.int[1,10]} 7-23 * * *

And referenced it like so:

@Scheduled(cron = "${batch.scheduler.cron}")
public void runJob()
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @answer
  • Low reputation (1):
Posted by: TheLittleChimp