Merge "Run periodic_task in a with a dynamic timer"

This commit is contained in:
Jenkins 2014-03-25 23:27:30 +00:00 committed by Gerrit Code Review
commit fadfa2fd80

View File

@ -49,9 +49,10 @@ class PeriodicService(rpc_service.Service, periodic_task.PeriodicTasks):
def start(self): def start(self):
super(PeriodicService, self).start() super(PeriodicService, self).start()
admin_context = context.RequestContext('admin', 'admin', is_admin=True) admin_context = context.RequestContext('admin', 'admin', is_admin=True)
self.tg.add_timer(cfg.CONF.periodic_interval, self.tg.add_dynamic_timer(
self.manager.periodic_tasks, self.manager.periodic_tasks,
context=admin_context) periodic_interval_max=cfg.CONF.periodic_interval,
context=admin_context)
def prepare_service(argv=[]): def prepare_service(argv=[]):