[Ovirt-devel] [PATCH server] Also print reconnect message in log.

Ian Main imain at redhat.com
Fri May 29 22:14:57 UTC 2009


It seems people were getting confused by the message that taskomatic was
disconnected and not logging a reconnect message.  This patch makes it
log on reconnect as well.

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

diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb
index 71432d2..1b4d83b 100755
--- a/src/task-omatic/taskomatic.rb
+++ b/src/task-omatic/taskomatic.rb
@@ -842,14 +842,19 @@ class TaskOmatic
   end
 
   def mainloop()
+    was_disconnected = false
     loop do
 
       if not @broker.connected?
-        @logger.error("Cannot implement tasks, not connected to broker.  Sleeping.")
+        @logger.info("Cannot implement tasks, not connected to broker.  Sleeping.")
         sleep(@sleeptime * 3)
+        was_disconnected = true
         next
       end
 
+      @logger.info("Reconnected, resuming task checking..") if was_disconnected
+      was_disconnected = false
+
       tasks = Array.new
       begin
         tasks = Task.find(:all, :conditions =>
-- 
1.6.0.6




More information about the ovirt-devel mailing list