Private GIT

Skip to content
Snippets Groups Projects
Commit 0468ca5e authored by Alexandre Beloin's avatar Alexandre Beloin
Browse files

Scheduler: apply the try on the whole run function

parent 7b5a3377
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ class Scheduler(threading.Thread): ...@@ -51,7 +51,7 @@ class Scheduler(threading.Thread):
return False return False
def run(self): def run(self):
try:
while not self.stop.is_set(): while not self.stop.is_set():
current_time = datetime.datetime.now() current_time = datetime.datetime.now()
...@@ -73,14 +73,10 @@ class Scheduler(threading.Thread): ...@@ -73,14 +73,10 @@ class Scheduler(threading.Thread):
if should_run: if should_run:
self.lastRun = current_time self.lastRun = current_time
try:
if not self.silent: if not self.silent:
logger.log(u"Starting new thread: " + self.name, logger.DEBUG) logger.log(u"Starting new thread: " + self.name, logger.DEBUG)
self.action.run(self.force) self.action.run(self.force)
except Exception, e:
logger.log(u"Exception generated in thread " + self.name + ": " + ex(e), logger.ERROR)
logger.log(repr(traceback.format_exc()), logger.DEBUG)
if self.force: if self.force:
self.force = False self.force = False
...@@ -89,3 +85,6 @@ class Scheduler(threading.Thread): ...@@ -89,3 +85,6 @@ class Scheduler(threading.Thread):
# exiting thread # exiting thread
self.stop.clear() self.stop.clear()
except Exception, e:
logger.log(u"Exception generated in thread " + self.name + ": " + ex(e), logger.ERROR)
logger.log(repr(traceback.format_exc()), logger.DEBUG)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment