Skip to content

Commit

Permalink
Don't run the periodic task if ticks_between_runs is below zero
Browse files Browse the repository at this point in the history
if the user sets say image_cache_manager_interval=-1, then
don't add the task to the list of periodic tasks

remove extra braces that i had added

DocImpact

Fixes LP #1084232

Change-Id: Ieecd67ddbc70b815a88f40e72ca2899787d75988
  • Loading branch information
Davanum Srinivas committed Nov 29, 2012
1 parent 4b24907 commit 27868dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nova/manager.py
Expand Up @@ -125,8 +125,9 @@ def __init__(cls, names, bases, dict_):
if getattr(value, '_periodic_task', False):
task = value
name = task.__name__
cls._periodic_tasks.append((name, task))
cls._ticks_to_skip[name] = task._ticks_between_runs
if task._ticks_between_runs >= 0:
cls._periodic_tasks.append((name, task))
cls._ticks_to_skip[name] = task._ticks_between_runs


class Manager(base.Base):
Expand Down

0 comments on commit 27868dd

Please sign in to comment.