Package org.kissweb
Class Cron
java.lang.Object
org.kissweb.Cron
System to auto-run Groovy files on a defined period as Unix cron does.
The file that controls what gets run and when is in backend/CronTasks/crontab
The groovy files it runs are located in the backend/CronTasks directory.
See the file backend/crontab
Author: Blake McBride
Date: 12/22/21
Author: Blake McBride
Date: 12/22/21
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Cron
public Cron(String crontabFileName, Supplier<Object> getParameter, Consumer<Object> success, Consumer<Object> failure) throws IOException Start the cron process.- Parameters:
crontabFileName
- the path to the crontab filegetParameter
- method that returns the parameter passed to the Groovy cron jobsuccess
- method that performs the cleanup action after a successful run of the cron jobfailure
- method that performs the cleanup action after a failed run of the cron job- Throws:
IOException
-
-
Method Details
-
cancel
public void cancel()Stop further evocation of all cron jobs.
-