Error or Timeout on PHP Scheduled Task Pointing to Certain Lists

Status
Not open for further replies.
Try running that query by hand again. Just replace any occurences of #_ with your site's db prefix. As Troester says, that's simply because the db prefix replacement happens within J!'s database API, so at the point we render the debug for it, the query still has #_'s instead of the db prefix.

Is there a size limitation on the list's data when using crons? The lists I am trying to point to that aren't working have more data than the simple lists that do work. Nothing crazy, ~1,000s versus ~100s of rows.

Nope, no size limits beyond what your system can handle. HOWEVER ... remember that we aren't just selecting rows. We are rendering the element data, as if it was going to be output for display. And that takes time - orders of magnitude more than simply selecting raw data from a database. Usually when you display a table, you aren't trying to render more than 20 or so rows of data for display. Trying to render thousands of rows can take a lot of time, and may well run you out of script execution time.

Just a word on the cron, I am just looking for a well-traveled list to point to in order to crunch some data. I'm not actually using the list's data in the processing. There is a lot of processing and it isn't able to complete in a single run on my shared hosting. So it is set to run repeatedly (every minute) until it completes which takes several hours depending on the traffic to my list. Perhaps there is another way to accomplish this?

Erm ... if you don't actually need any list data, and just want to run some PHP ... don't select a list. Should be as simple as that. Selecting a list is optional. Not selecting one just means $data will be empty instead of being populated with list data.

-- hugh
 
Just to reiterate, a cron was working before on this list.
I don't know if there was any code change. But "working before" could have been "working on the limit" and know it's hitting the limit because of some more records.

If you don't need to select this specific list you can use a dummy one with just one record.
 
OBTW ... by "well travelled list" I'm assuming you mean one which gets lots of page loads. Which probably means you are assuming that the running of cron jobs is related to which list you select. Which it isn't.

Our cron plugin runs on every front end page load, as one of the very last things that J! does, once it has output the page (so you won't notice it when loading a page as a user). It then loads the metadata (settings from #__fabrik_crons) for all your cron plugins, which includes a "last_run", as well as the frequency settings you set for each one. Then it simply runs any which are due (or overdue).

So ... it doesn't matter what list you select. Or if you select one at all. The main "Fabrik Cron" system plugin runs on every page load, and handles dispatching the actual individual crons as required.

-- hugh
 
BTW, what I usually recommend if you want to run a cron predictably, is to enable the "require query string" option, which sets it so that plugin will ONLY run if the page is being loaded with &fabrik_cron=1 on the query string. Which will never be the case, unless you put it there.

Then set up an actual UNIX cron job, which does a "wget http://your.site/index.php?fabrik_cron=1", and set that to run at whatever your desired frequency is. Your hosts control panel should provide you a way to set up cron jobs. If not, there are freebie services out there that let you do stuff like that.

-- hugh
 
Here it would be a nice feature if you could add the cron id so it will run only the specific cronjob (not all with querystring).
 
Yup, I started implementing that a few weeks ago, after we talked about it on Skype, got distracted, then lost the changes in one of my frequent git cockups. I'll do it soon.

-- hugh
 
So ... it doesn't matter what list you select. Or if you select one at all. The main "Fabrik Cron" system plugin runs on every page load, and handles dispatching the actual individual crons as required.

Thank you for the info! I did not know this about crons. Once I remove my selected list, my cron run as expected and seeming faster too. :) You were right Troester, this must have been working just at the limit before.

I have updated the wiki to include it for future reference: http://fabrikar.com/forums/index.php?wiki/scheduled-tasks/&noRedirect=1

Then set up an actual UNIX cron job, which does a "wget http://your.site/index.php?fabrik_cron=1", and set that to run at whatever your desired frequency is. Your hosts control panel should provide you a way to set up cron jobs. If not, there are freebie services out there that let you do stuff like that.

Also good to know for the future if needed!
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top