Skip to content

Commit

Permalink
blocks/rss_client: MDL-13932 Incease timeout when adding feeds
Browse files Browse the repository at this point in the history
In order to stop 'slow loading feeds' causing performance problems
with standard moodle pages, i've set the timeout for simplepie quite
low. When cron runs i've set this timeout high and cache duration low.

The intention is that cron does all the hard work of connecting to remote
sites and users get this fast fast fast from cache.

However, in the case of adding a feed its probably better to try and get the
feed more agressively..
  • Loading branch information
poltawski committed Jul 31, 2009
1 parent 6d2382b commit 5966474
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blocks/rss_client/editfeed.php
Expand Up @@ -74,7 +74,11 @@ function definition() {
function validation($data, $files) {
$errors = parent::validation($data, $files);

$rss = new moodle_simplepie($data['url']);
$rss = new moodle_simplepie();
// set timeout for longer than normal to try and grab the feed
$rss->set_timeout(10);
$rss->set_feed_url($data['url']);
$rss->init();

if ($rss->error()) {
$errors['url'] = get_string('errorloadingfeed', 'block_rss_client', $rss->error());
Expand Down

0 comments on commit 5966474

Please sign in to comment.