aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-02-23 18:49:50 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-02-23 18:49:50 -0800
commit92a7b7822e1f65a53b6d1ed66f3fc0b73c639f0d (patch)
tree2bb799e55d9b974d43e2480d69e91b322dc3cead
parentFix arg. (diff)
downloadbackend-92a7b7822e1f65a53b6d1ed66f3fc0b73c639f0d.tar.gz
backend-92a7b7822e1f65a53b6d1ed66f3fc0b73c639f0d.tar.bz2
backend-92a7b7822e1f65a53b6d1ed66f3fc0b73c639f0d.zip
Improve sleep code.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--lib/storage.rb6
1 files 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)