forbid looping tasks with an interval of 0
This severly harm the server, and generally are the result of a
baaad configuration file. We want to stop the server asap when
this is detected to give people a chance to fix the configuration.
--- a/server/utils.py Sat May 29 09:54:07 2010 +0000
+++ b/server/utils.py Sat May 29 09:57:02 2010 +0000
@@ -123,6 +123,10 @@
class LoopTask(object):
"""threaded task restarting itself once executed"""
def __init__(self, interval, func, args):
+ if interval <= 0:
+ raise ValueError('Loop task interval must be > 0 '
+ '(current value: %f for %s)' % \
+ (interval, func.__name__))
self.interval = interval
def auto_restart_func(self=self, func=func, args=args):
try: