summaryrefslogtreecommitdiffstats
path: root/nova/manager.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-14 22:27:40 +0000
committerGerrit Code Review <review@openstack.org>2013-01-14 22:27:40 +0000
commitc6fcfa509ee4df41ab30f8cdc1daa88f39b33c86 (patch)
treeb7a2ddfd98ee3cdfee5bfdf0cdd4e1fa45273eb2 /nova/manager.py
parentb097b59c375c853170954724bbc6bdfff24e08ea (diff)
parentd0c5fe6be4d6b00c5947f4b2a37ca9f496941e8b (diff)
downloadnova-c6fcfa509ee4df41ab30f8cdc1daa88f39b33c86.tar.gz
nova-c6fcfa509ee4df41ab30f8cdc1daa88f39b33c86.tar.xz
nova-c6fcfa509ee4df41ab30f8cdc1daa88f39b33c86.zip
Merge "Fix logic error in periodic task wait code."
Diffstat (limited to 'nova/manager.py')
-rw-r--r--nova/manager.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/manager.py b/nova/manager.py
index cb15b776e..7df63f719 100644
--- a/nova/manager.py
+++ b/nova/manager.py
@@ -215,8 +215,9 @@ class Manager(base.Base):
if self._periodic_spacing[task_name] is None:
wait = 0
else:
- wait = time.time() - (self._periodic_last_run[task_name] +
- self._periodic_spacing[task_name])
+ due = (self._periodic_last_run[task_name] +
+ self._periodic_spacing[task_name])
+ wait = max(0, due - time.time())
if wait > 0.2:
if wait < idle_for:
idle_for = wait