Skip to content

Commit

Permalink
update is_indexing_finished to also check beanstalk version
Browse files Browse the repository at this point in the history
  • Loading branch information
j1z0 committed May 31, 2018
1 parent 5718dba commit a2f8a19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dcicutils/beanstalk_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,19 @@ def get_es_from_bs_config(env):
return item.split('=')[1].strip(':80')


def is_indexing_finished(bs):
def is_indexing_finished(bs, version=None):
is_beanstalk_ready(bs)
bs_url = get_beanstalk_real_url(bs)
if not bs_url.endswith('/'):
bs_url += "/"
# server not up yet
try:
# check to see if our version is updated
if version:
info = beanstalk_info(bs)
if version == info.get('VersionLabel'):
raise Exception("Beanstalk version has not updated from %s" % version)

health_res = ff_utils.authorized_request(bs_url + 'counts?format=json', ff_env=bs)
totals = health_res.json().get('db_es_total').split()

Expand Down

0 comments on commit a2f8a19

Please sign in to comment.