From ec6a3dc90e8a495337bd08252a2c3cb2cec91a1c Mon Sep 17 00:00:00 2001 From: Ryan Huber Date: Mon, 24 Nov 2014 19:01:41 -0800 Subject: [PATCH] protect from bad functions in cron --- rtmbot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rtmbot.py b/rtmbot.py index d9b0767..8a7bedb 100755 --- a/rtmbot.py +++ b/rtmbot.py @@ -119,7 +119,13 @@ class Job(object): return self.__str__() def check(self): if self.lastrun + self.interval < time.time(): - self.function() + if not debug: + try: + self.function() + except: + dbg("problem") + else: + self.function() self.lastrun = time.time() pass