server/utils.py
branchstable
changeset 5602 277b15d6d3ed
parent 5601 92cf309672ca
child 5606 61b28589d33f
--- 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: