Proper way to set a scheduled admin task
Posted: Thu Sep 05, 2024 11:27 pm
I need to make a script that periodically fetches a JSON and adds some products/categories to the catalog.
I made a controller in admin/ with no view. It can successfully modify the catalog using the built in models, but, from what I understand, since it's an admin extension, even if I don't have any checks in the class code I must be logged in browser in to call it. Therefore using Cron to periodically call this module with a cURL is suboptimal, if even possible.
Question: should I just make a separate script that connects and modifies the database by itself, or is there a way to utilize built in models?
Thanks in advance.
I made a controller in admin/ with no view. It can successfully modify the catalog using the built in models, but, from what I understand, since it's an admin extension, even if I don't have any
Code: Select all
$this->user->hasPermission
Question: should I just make a separate script that connects and modifies the database by itself, or is there a way to utilize built in models?
Thanks in advance.