Some tasks have to be done more than one time. That could be the task for clearing the cache or making backups. To execute this task without a Cron, we made a possibility to do this inside ContentLion.
On every page visit we do a task, if it does exists. For this reason you can't use it for every task:
- Tasks should not take much time, because the user is waiting for the site.
- If the page isn't visted every second, some tasks will be executed later than the planned time
If you want task that do more than this, you have to use crons. But for small things, this is a good method for you.
Create a task
At this time the creation of a task has to be executed over sql. You can add a new row in the task-table. We have the following columns:
- script: Path to your script (relative to ContentLion root)
- interval: Repeat of executution in minutes
- lastExecution: The timestamp where the task was executed the last time. It will be filled from ContentLion