Skip to content

Commit

Permalink
MarketMonitor: reset timer on reconnet, and add helpful log message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Folkinshteyn committed May 13, 2015
1 parent f700924 commit 07ddc9d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MarketMonitor/plugin.py
Expand Up @@ -77,6 +77,7 @@ def _reconnect(self, repeat=True):
self.conn.close()
self.conn.open(self.registryValue('server'),
self.registryValue('port'))
self.nextsend = time.time()
return True
except Exception, e:
# this may get verbose, but let's leave this in for now.
Expand Down Expand Up @@ -112,6 +113,7 @@ def _monitor(self, irc):
irc.queueMsg(ircmsgs.privmsg(chan, output))
self.nextsend = time.time()+(conf.supybot.protocols.irc.throttleTime() * len(outputs))
if time.time() - self.nextsend > 300: # 5 minutes no data
self.log.info("MarketMonitor reconnecting due to silent feed.")
self._reconnect() # must mean feed is quietly dead, as sometimes happens.
self.marketdata = {}
self.raw = []
Expand Down

0 comments on commit 07ddc9d

Please sign in to comment.