blocks/rss_client: MDL-13932 Incease timeout when adding feeds

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..
This commit is contained in:
poltawski 2009-07-31 21:19:55 +00:00
parent 6d2382b6d7
commit 5966474298

View File

@ -74,7 +74,11 @@ class feed_edit_form extends moodleform {
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());