commit:     92a7b7822e1f65a53b6d1ed66f3fc0b73c639f0d
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 24 02:49:50 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Feb 24 02:49:50 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ag.git;a=commit;h=92a7b782

Improve sleep code.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

---
 lib/storage.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/storage.rb b/lib/storage.rb
index c054f9e..bf90202 100644
--- a/lib/storage.rb
+++ b/lib/storage.rb
@@ -87,8 +87,10 @@ module Ag::Storage
       })
 
     # Give elasticsearch some time to process the new index
-       puts $es.cluster.health
-    sleep 1
+    while $es.cluster.health['status'] != 'green' do
+        sleep 0.05
+        puts $es.cluster.health
+    end
   end
 
   def get_content(message, filename)

Reply via email to