Skip to content

Commit f039272

Browse files
committed
minor timer and debug improvements
1 parent afa0bb7 commit f039272

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/shared/helper.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def func_wrapper(self, module, input):
181181
self.log.debug(msg)
182182

183183
except NotInitialisedException as e:
184-
self.log.warn("Rule skipped: " + str(e))
184+
self.log.warn("Rule skipped: " + str(e) + " \n" + traceback.format_exc())
185185
except:
186186
self.log.error("Rule execution failed:\n" + traceback.format_exc())
187187

@@ -231,7 +231,12 @@ def __init__(self,log, duration, callback, args=[], kwargs={}):
231231
def handler(self):
232232
try:
233233
self.callback(*self.args, **self.kwargs)
234-
activeTimer.remove(self)
234+
try:
235+
activeTimer.remove(self)
236+
except ValueError:
237+
# can happen when timer is executed and canceled at the same time
238+
# could be solved with a LOCK, but this solution is more efficient, because it works without a LOCK
239+
pass
235240
except:
236241
self.log.error(u"{}".format(traceback.format_exc()))
237242
raise

0 commit comments

Comments
 (0)