]> jfr.im git - erebus.git/commitdiff
fix watchdogtimer so it will run more than once
authorzonidjan <redacted>
Wed, 4 Oct 2017 23:24:06 +0000 (18:24 -0500)
committerzonidjan <redacted>
Wed, 4 Oct 2017 23:24:06 +0000 (18:24 -0500)
bot.py

diff --git a/bot.py b/bot.py
index 060c172cd84383e82e8ee13e07d8d066900c0f04..11b7ac50636ccfeab7cc88b1b39a37d4fd1de03c 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -35,7 +35,7 @@ class Bot(object):
                self.conn = BotConnection(self, bind, server, port)
 
                self.lastreceived = time.time() #time we last received a line from the server
-               self.watchdogtimer = MyTimer(self.parent.cfg.get('watchdog', 'interval', default=30), self.watchdog)
+               self.watchdog()
 
                self.msgqueue = deque()
                self.slowmsgqueue = deque()
@@ -50,7 +50,7 @@ class Bot(object):
        def watchdog(self):
                if time.time() > self.parent.cfg.get('watchdog', 'maxtime', default=300)+self.lastreceived:
                        self.parse("ERROR :Fake-error from watchdog timer.")
-
+               self.watchdogtimer = MyTimer(self.parent.cfg.get('watchdog', 'interval', default=30), self.watchdog)
 
        def log(self, *args, **kwargs):
                self.parent.log(self.nick, *args, **kwargs)