[Ovirt-devel] [PATCH server] Make taskomatic not do tasks if not connected to qpidd.

Ian Main imain at redhat.com
Fri May 29 19:40:20 UTC 2009


This patch just checks the broker to see if it's connected before
attempting to implement tasks.

Signed-off-by: Ian Main <imain at redhat.com>
---
 src/task-omatic/taskomatic.rb |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb
index 5393c29..71432d2 100755
--- a/src/task-omatic/taskomatic.rb
+++ b/src/task-omatic/taskomatic.rb
@@ -843,6 +843,13 @@ class TaskOmatic
 
   def mainloop()
     loop do
+
+      if not @broker.connected?
+        @logger.error("Cannot implement tasks, not connected to broker.  Sleeping.")
+        sleep(@sleeptime * 3)
+        next
+      end
+
       tasks = Array.new
       begin
         tasks = Task.find(:all, :conditions =>
-- 
1.6.0.6




More information about the ovirt-devel mailing list