diff --git a/django_q/conf.py b/django_q/conf.py index ccf8a5d..dfa719a 100644 --- a/django_q/conf.py +++ b/django_q/conf.py @@ -73,6 +73,8 @@ class Conf(object): # Guard loop sleep in seconds GUARD_CYCLE = conf.get('guard_cycle', 0.5) + if GUARD_CYCLE <= 0 or GUARD_CYCLE >= 60: + raise ValueError('`guard_cycle` must be greater than 0 and less than 60 sec') # Disable the scheduler SCHEDULER = conf.get('scheduler', True) diff --git a/docs/configure.rst b/docs/configure.rst index 73a1c6a..714881a 100644 --- a/docs/configure.rst +++ b/docs/configure.rst @@ -81,7 +81,7 @@ Limits the amount of successful tasks saved to Django. guard_cycle ~~~~~~~~~~~ -Guard loop sleep in seconds +Guard loop sleep in seconds, must be greater than 0 and less than 60. .. _sync: