Skip to content

Commit

Permalink
Merge branch 'a190638523095652_improve_health_check'
Browse files Browse the repository at this point in the history
  • Loading branch information
ktarasz committed Feb 7, 2017
2 parents 0f5f761 + f7f773f commit f5b57a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/openprocurement/api/views/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
def get_spore(request):
tasks = getattr(request.registry, 'admin_couchdb_server', request.registry.couchdb_server).tasks()
output = {task['replication_id']: task['progress'] for task in tasks if 'type' in task and task['type'] == 'replication'}
health_threshold = request.params.get('health_threshold', request.registry.health_threshold)
try:
health_threshold = float(request.params.get('health_threshold', request.registry.health_threshold))
except ValueError, e:
health_threshold = request.registry.health_threshold
health_threshold_func_name = request.params.get('health_threshold_func', request.registry.health_threshold_func)
health_threshold_func = HEALTH_THRESHOLD_FUNCTIONS.get(health_threshold_func_name, all)
if not(output and health_threshold_func(
Expand Down

0 comments on commit f5b57a2

Please sign in to comment.