Revert "[14.10.20] Probes broken for some reason"

This reverts commit e50e8cc9
This commit is contained in:
andrewso 2020-10-14 15:42:39 +01:00
parent e50e8cc972
commit cc3a1b0356

View File

@ -12,17 +12,17 @@ def health():
@app.route('/readiness')
def readiness():
# result = requests.request("GET", 'http://localhost:9090/predictProbeTest')
# result = json.loads(result.text)
result = requests.request("GET", 'http://localhost:9090/predictProbeTest')
result = json.loads(result.text)
if "result" != "":
if result != "":
return json.dumps({
'status': 'UP',
'app': {
'name': 'CryptoSky spam filter',
'description': 'Projects spam filter service that classifies whether the tweet that is sent to it is spam or not',
'check_status': 'Success - Call to prediction endpoint',
'response': "{'result': 'spam', 'tweet': 'Fake Test Tweet'}"
'response': result
}
}), 200, {'ContentType': 'application/json'}
else:
@ -32,7 +32,7 @@ def readiness():
'name': 'CryptoSky spam filter',
'description': 'Projects spam filter service that classifies whether the tweet that is sent to it is spam or not',
'check_status': 'Failure - Call to prediction endpoint',
'response': "{'result': 'spam', 'tweet': 'Fake Test Tweet'}"
'response': result
}
}), 503, {'ContentType': 'application/json'}