Closed
Description
This is a COPY of Issue 1233: Future feature: pseudo cron or cron support, filed on Google Code before the project was moved on Github.
- Submitted on 2012-11-11T11:42:50.000Z by ozh...@gmail.com
- Status: Accepted
Please review the original issue and especially its comments. Comments here on closed issues will be ignored. Thanks.
Original description
YOURLS should have a cron API, like the one there is in WP.
Principles:
- cron actions will be stored in the options table. Need to think & dissect how WP does it, but probably something like storing an array of ( timestamp when the cronjob has been created, job frequency, a YOURLS action, optional arguments )
- there will be a yourls-cron.php file in the root folder that will be either wget-able by a real cron, or parsed within YOURLS at regular intervals.
Roadmap:
- First, implement it so it requires a real crontab that the user will set up. Something like:
*/10 * * * * wget http://sho.rt/yourls-cron.php > /dev/null 2>&1
- Next iteration: have something that works without the need of a crontab. The difficulty here is to trigger cronjob checks as frequently as possible (hence, on shorturl redirection) but have no impact on redirection performance (ie, we don't want to trigger a log archiving that takes several seconds to finish when someone just wants to be redirected to a long URL)