AbanteCart Community
Shopping Cart Operations => Support => General Support => Topic started by: digitalt on October 05, 2016, 07:10:49 AM
-
Is there a way to set Cache Clear in Scheduled Tasks? I'd like to do this a couple times a day. I've looked over the documentation and am totally lost on how to implement this.
-
1. You have file public_html/task.php. It can be run by cron with some interval.
2. Every time it looks into database for scheduled tasks (task with status 'ready'), takes all it steps details (from database) and loop one-by-one.
3. Every step have controller for call. It must be task-type (see admin/controller/task folder for examples)
Also you can set low expiration time for cache (see $this->expire = ( $expiration ) ? $expiration : 86400; inside core/cache/driver.php)
-
Is there a way to set Cache Clear in Scheduled Tasks? I'd like to do this a couple times a day. I've looked over the documentation and am totally lost on how to implement this.
Digitalt, any ideas what we can improve in the manual? I know it is not as good as it can be.
Thank you
-
For a basic manual it's okay, but maybe add tips like above to different sections if appropriate. Not everyone's a programmer, but a lot of folks can at least find files and make changes to fit their needs if they know where to go. The cache expiration time is a great example.
-
1. You have file public_html/task.php. It can be run by cron with some interval.
2. Every time it looks into database for scheduled tasks (task with status 'ready'), takes all it steps details (from database) and loop one-by-one.
3. Every step have controller for call. It must be task-type (see admin/controller/task folder for examples)
Also you can set low expiration time for cache (see $this->expire = ( $expiration ) ? $expiration : 86400; inside core/cache/driver.php)
Theoretically I could add a scheduler for cache clear using the same methods as backup? I took a quick look and it seems possible. I need to have the task written to the DB first though. I have a test site I can work with.
It would be nice in a future release to expand on the scheduler/cron capabilities. I have seen this function in numerous types of scripts and it was a great feature.
-
1. You have file public_html/task.php. It can be run by cron with some interval.
2. Every time it looks into database for scheduled tasks (task with status 'ready'), takes all it steps details (from database) and loop one-by-one.
3. Every step have controller for call. It must be task-type (see admin/controller/task folder for examples)
Also you can set low expiration time for cache (see $this->expire = ( $expiration ) ? $expiration : 86400; inside core/cache/driver.php)
Theoretically I could add a scheduler for cache clear using the same methods as backup? I took a quick look and it seems possible. I need to have the task written to the DB first though. I have a test site I can work with.
It would be nice in a future release to expand on the scheduler/cron capabilities. I have seen this function in numerous types of scripts and it was a great feature.
Let us know how it goes and we can improve scheduler/cron capabilities. Possibly we can create pre-build commandline tasks to backup and clear cache.
-
That's what I was thinking. Built in cron capabilities is the easiest for non techie folks and can accomplish a lot.