# HG changeset patch # User Alexandre Fayolle # Date 1275127022 0 # Node ID 277b15d6d3edd46ad4abc086dd1da3bc7774b021 # Parent 92cf309672ca554f6d313b403200cde10de12712 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. diff -r 92cf309672ca -r 277b15d6d3ed server/utils.py --- 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: