aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/crawler.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-04-08 07:46:38 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-04-08 07:46:38 +0200
commit50192b8aab87eebad1df8d699355dae6024c6406 (patch)
treeabd3eadbec56dfdac649fbd4b303adc35fe92484 /pyaggr3g470r/crawler.py
parentMerged in jaesivsm/pyaggr3g470r (pull request #7) (diff)
downloadnewspipe-50192b8aab87eebad1df8d699355dae6024c6406.tar.gz
newspipe-50192b8aab87eebad1df8d699355dae6024c6406.tar.bz2
newspipe-50192b8aab87eebad1df8d699355dae6024c6406.zip
The minimum error count is now specified in the configuration file.
Diffstat (limited to 'pyaggr3g470r/crawler.py')
-rw-r--r--pyaggr3g470r/crawler.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pyaggr3g470r/crawler.py b/pyaggr3g470r/crawler.py
index ded9df6f..c8993c76 100644
--- a/pyaggr3g470r/crawler.py
+++ b/pyaggr3g470r/crawler.py
@@ -20,9 +20,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__author__ = "Cedric Bonhomme"
-__version__ = "$Revision: 3.1 $"
+__version__ = "$Revision: 3.2 $"
__date__ = "$Date: 2010/09/02 $"
-__revision__ = "$Date: 2015/02/08 $"
+__revision__ = "$Date: 2015/04/08 $"
__copyright__ = "Copyright (c) Cedric Bonhomme"
__license__ = "AGPLv3"
@@ -71,9 +71,11 @@ def parse_feed(user, feed):
except Exception as e:
feed.last_error = str(e)
finally:
+ print(feed.link)
if data is None:
+ print('error')
feed.error_count += 1
- if feed.error_count > 2:
+ if feed.error_count >= conf.DEFAULT_MAX_ERROR:
feed.enabled = False
db.session.commit()
return
@@ -83,7 +85,7 @@ def parse_feed(user, feed):
#logger.error(a_feed['bozo_exception'])
feed.last_error = str(a_feed['bozo_exception'])
feed.error_count += 1
- if feed.error_count > 2:
+ if feed.error_count >= conf.DEFAULT_MAX_ERROR:
feed.enabled = False
db.session.commit()
if a_feed['entries'] == []:
bgstack15