summaryrefslogtreecommitdiffstats
path: root/ircbot/rssbot.py
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-01-09 23:46:26 +0100
committerlassulus <lassulus@googlemail.com>2014-01-09 23:46:26 +0100
commitf4c627b4a70e09c122973274dba4399a10751adc (patch)
tree768a3968c74b84f10bfb883afa7f0356efbd9afb /ircbot/rssbot.py
parent35e13322e83e95d7b4e671e72bcd885277433f99 (diff)
ircbot: stop retrying after 20 fails
Diffstat (limited to 'ircbot/rssbot.py')
-rwxr-xr-xircbot/rssbot.py5
1 files changed, 5 insertions, 0 deletions
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)