I want my tasks to be performed every X seconds, there one to one corresponded to the task and X. Also, new tasks can be registered at runtime at their own intervals.
I tried to write a cron expression for such scenarios, but the documentation says that the value of seconds cannot be more than 59. Thus, the cron expression looks like this: "0/63 * * * *?" is invalid.
At first glance, the solution to this problem looked like this: "0/3 0/1 * * *?", But this means a completely different thing: run the task every three seconds of every minute.
Can you suggest what is the correct solution (cron expression) for this? I know I can use simple timers, but I have to use cron jobs using Quartz.
source
share