mecha-cms / mecha

Minimalist content management system.

Home Page:https://mecha-cms.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO: Add `every` Function to Schedule Task by Time Interval

taufik-nurrohman opened this issue · comments

The syntax would look something like this:

every('1 hour', function() {
    // Update cache
});

This function simplifies the task implementation of Guard::token() and Cache::live() method in the future.

Related: https://developer.wordpress.org/reference/functions/wp_schedule_event

Ummm… probably too complex for a minimalist flat-file CMS. Will consider to make this as a separate extension. Use a service like https://cron-job.org combined with route extension to create scheduled tasks.