[08.10.20] New probe so that it doesn't spit out logs

This commit is contained in:
andrewso 2020-10-08 17:21:44 +01:00
parent c4953ca6cc
commit 47569f2ea6
2 changed files with 6 additions and 3 deletions

View File

@ -27,6 +27,10 @@ def tweetPredict():
return json.dumps({'result': result, 'tweet': tweet}), 200, {'ContentType':'application/json'}
@app.route('/sentimentProbeTest', methods=['GET'])
def sentimentProbeTrst():
return json.dumps({'result': {'Score': {'neg': 0.0, 'neu': 1.0, 'pos': 0.0, 'compound': 0.0}, 'Compound': 0.0}, 'tweet': 'Fake Text'}), 200, {'ContentType':'application/json'}
def callSentimentAnalyser():
analyser.set_newSentiment()
@ -44,4 +48,3 @@ if __name__ == '__main__':
Thread(target=callProbes).start()
Thread(target=callSentimentAnalyser).start()
# Thread(target=callNewsFilter).start()

View File

@ -13,7 +13,7 @@ def health():
@app.route('/readiness')
def readiness():
result = requests.request("GET", 'http://0.0.0.0:9090/sentiment?tweet=Bitcoin%20is%20doing%20very%20well')
result = requests.request("GET", 'http://0.0.0.0:9090/sentimentProbeTest')
result = json.loads(result.text)
if result != "" :