[task] allow interval=0 for looping tasks
There is valid usecase for perpetual running task.
--- a/doc/3.17.rst Tue Apr 23 18:15:10 2013 +0200
+++ b/doc/3.17.rst Wed Apr 24 11:58:49 2013 +0200
@@ -32,6 +32,8 @@
``ActualNotificationOp`` the new operation use the more efficient *data*
idiom.
+* Looping task can now have a ``0`` interval.
+
Deprecation
---------------------
--- a/server/utils.py Tue Apr 23 18:15:10 2013 +0200
+++ b/server/utils.py Wed Apr 24 11:58:49 2013 +0200
@@ -145,8 +145,8 @@
class LoopTask(object):
"""threaded task restarting itself once executed"""
def __init__(self, tasks_manager, interval, func, args):
- if interval <= 0:
- raise ValueError('Loop task interval must be > 0 '
+ if interval < 0:
+ raise ValueError('Loop task interval must be >= 0 '
'(current value: %f for %s)' % \
(interval, func_name(func)))
self._tasks_manager = tasks_manager