From 2b42968a53c70f2fd759a22e8e5aeadc18ae65f6 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Wed, 7 Dec 2011 07:25:18 +0000 Subject: Refactors periodic tasks to use a decorator. Additional work: 1. Added support for tasks being scheduled at differing rates via the `ticks_between_runs` argument. 2. Fixed `reclaim_queued_deletes` so that it doesn't run if `FLAGS.reclaim_instance_interval` is 0. Change-Id: I18c01baf07bd06301a6fe26a7b29dc2452a4fa96 --- nova/service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nova/service.py') diff --git a/nova/service.py b/nova/service.py index fe6bf8e59..c56973907 100644 --- a/nova/service.py +++ b/nova/service.py @@ -252,9 +252,10 @@ class Service(object): except Exception: pass - def periodic_tasks(self): + def periodic_tasks(self, raise_on_error=False): """Tasks to be run at a periodic interval.""" - self.manager.periodic_tasks(context.get_admin_context()) + ctxt = context.get_admin_context() + self.manager.periodic_tasks(ctxt, raise_on_error=raise_on_error) def report_state(self): """Update the state of this service in the datastore.""" -- cgit