From f4c627b4a70e09c122973274dba4399a10751adc Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 9 Jan 2014 23:46:26 +0100 Subject: ircbot: stop retrying after 20 fails --- ircbot/rssbot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ircbot/rssbot.py b/ircbot/rssbot.py index 79276a3a..7240fa90 100755 --- a/ircbot/rssbot.py +++ b/ircbot/rssbot.py @@ -41,6 +41,7 @@ class RssBot(irc.bot.SingleServerIRCBot): self.loop = False def updateloop(self): + failcount=0 while True: try: self.feed = feedparser.parse(self.url) @@ -49,6 +50,10 @@ class RssBot(irc.bot.SingleServerIRCBot): break except: print(self.name + ': rss timeout occured') + failcount+=1 + if failcount>20: + print(self.name + ' is broken, going to die') + self.stop() while self.loop: try: self.feed = feedparser.parse(self.url) -- cgit v1.2.3