Hello,
I need a batch task to be executed only on demand during 2 dates.
This task should never be runned automatically.
So I cannot put a .every() on it, neither a .cron(). The language force me to give one of the two.
To get around of this, I did put the cron “.cron(‘0 0 0 30 2 0 *’)”. I hope it will be enough to not be executed, if you think the contrary please tell me. The sad part of this dirty approach is that I cannot use the replay between two date feature, it does not play well with .cron() task. So I need to make a record and replay the record then delete the record. Also part of the business part of the code, the query itself, is extracted out of the task.
Do you have another idea about a better way of implementing this batch task on demand ?
I was thinking that maybe removing the mandatory .every or .cron could made it.
Thanks for your advises.
Fabrice