How to update feeds

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only

How to update feeds

Postby 234my1 » 28 Dec 2010, 14:54

Hello,

I'm looking for a method to update my feeds in the background (on a regular basis). I read the article about UpdatingFeeds. Unfortunatley my webspace doesn't provide a cron service or console access.
However I could schedule a script (on a public cron service) to load a page on my webspace (e.g. update.php) on a regular basis.

Is there a possibility to pass a parameter (-feeds) to update.php, when making a HTTP call?
Does this even work?

Thanks for feedback or other creative ideas.
234my1
Bear Rating Trainee
Bear Rating Trainee
 
Posts: 6
Joined: 27 Dec 2010, 10:09

Re: How to update feeds

Postby Joschasa » 29 Dec 2010, 00:23

Without changing the code, it is not possible to use the update.php via http. It uses argv[] to determine the command line parameters, it wont work via http.
Perhaps it would work, if you just edit the first lines to accept $_GET[] or something like that. Or just set $op = "-feeds".
Joschasa
Bear Rating Trainee
Bear Rating Trainee
 
Posts: 34
Joined: 03 May 2010, 07:58

Re: How to update feeds

Postby fox » 31 Dec 2010, 12:28

You can call the update url as specified in the wiki (section about updating using wget), I guess it should work.
User avatar
fox
Ho-ho-ho
 
Posts: 4614
Joined: 27 Aug 2005, 18:53
Location: Saint-Petersburg, Russia

Re: How to update feeds

Postby 234my1 » 12 Feb 2011, 19:52

Thanks for your feedback. If I call the backend.php (with the respective parameters) in my browser, the feeds are refreshed.
Works :).

I checked some free cron services: All of them are stating, that they will quit a job after 30 seconds.
They recommend to add the following lines to the PHP script, to continue the execution when the job stopped:

set_time_limit(0);
ignore_user_abort(true);


Will this also work for TT-RSS (if I add them to backend.php)?
If so, would it make sense to include this in one of the next releases?
234my1
Bear Rating Trainee
Bear Rating Trainee
 
Posts: 6
Joined: 27 Dec 2010, 10:09

Re: How to update feeds

Postby fox » 12 Feb 2011, 21:01

The update sequence usually takes more than 30 seconds. You might want to limit the amount of feeds that get updated in one run so you wouldn't run out of time.

In backend.php:440,

Code: Select all
         update_daemon_common($link, 0, true, true);


It's the second parameter. You can try setting it to 5 feeds or so if it doesn't work properly.

If so, would it make sense to include this in one of the next releases?


I'm not sure it's really necessary - default maximum runtime interval of a PHP script usually is 30 seconds, apache kills the process afterwards.
User avatar
fox
Ho-ho-ho
 
Posts: 4614
Joined: 27 Aug 2005, 18:53
Location: Saint-Petersburg, Russia


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest