From ca9cc12b0c5fe9bf4418ce90fafe40188d835945 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 5 May 2015 20:30:26 +0200 Subject: [PATCH] Fixing cache issue causing memory leak --- bridges/CommonDreamsBridge.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php index 7dcf33d..07247e5 100644 --- a/bridges/CommonDreamsBridge.php +++ b/bridges/CommonDreamsBridge.php @@ -22,13 +22,15 @@ class CommonDreamsBridge extends BridgeAbstract{ function CommonDreamsExtractContent($url) { $html3 = file_get_html($url); $text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext; + $html3->clear(); + unset ($html3); return $text; } $html = file_get_html('http://www.commondreams.org/rss.xml') or $this->returnError('Could not request CommonDreams.', 404); $limit = 0; foreach($html->find('item') as $element) { - if($limit < 2) { + if($limit < 4) { $item = new \Item(); $item->title = $element->find('title', 0)->innertext; $item->uri = CommonDreamsUrl($element->find('guid', 0)->innertext); @@ -50,7 +52,7 @@ class CommonDreamsBridge extends BridgeAbstract{ } public function getCacheDuration(){ -// return 3600*2; // 2 hours - return 0; + return 3600; // 1 hours +// return 0; } }