XF 2.1 Limit Cron

Cupara

Well-known member
Is there a method to have a query within a cron to grab say 100 rows then break and grab the next 100? I'm just thinking ahead knowing that my add-on will process 1000s of rows be run and the API has a limit per minute and per hour.
 
Absolutely - look at the Job functionality, has all of this built in, including the ability to track the index of where you're up to.

Start with XF\Job\Manager and look at all the job classes in XF\Job\* for examples.

You can even have the job delayed to start at a later time - ideal to handle time based API limits.
 
Another question, is there a way to have a select option appear before running the Setup process for an add-on? It would help in lessening the insert time of a few data into tables.
 
I'm pretty sure there's not - addon install is pretty much automated.

Could you have a post-install process triggered manually by the administrator which inserts data? Build a new screen in the Tools section which allows the admin to select some options and then insert the data?
 
Back
Top Bottom