diff --git a/bothub_nlp_api/handlers/parse.py b/bothub_nlp_api/handlers/parse.py index c79b465..da8e8d7 100644 --- a/bothub_nlp_api/handlers/parse.py +++ b/bothub_nlp_api/handlers/parse.py @@ -120,29 +120,29 @@ def _parse( if "intent_ranking" not in answer or answer.get("intent_ranking") is None: answer.update({"intent_ranking": []}) - # log = threading.Thread( - # target=backend().send_log_nlp_parse, - # kwargs={ - # "data": { - # "text": text, - # "from_backend": from_backend, - # "user_agent": user_agent, - # "user": str(repository_authorization), - # "repository_version_language": int( - # repository.get("repository_version") - # ), - # "nlp_log": json.dumps(answer), - # "log_intent": [ - # { - # "intent": result["name"], - # "is_default": result["name"] == answer["intent"]["name"], - # "confidence": result["confidence"], - # } - # for result in answer.get("intent_ranking", []) - # ], - # } - # }, - # ) - # log.start() + log = threading.Thread( + target=backend().send_log_nlp_parse, + kwargs={ + "data": { + "text": text, + "from_backend": from_backend, + "user_agent": user_agent, + "user": str(repository_authorization), + "repository_version_language": int( + repository.get("repository_version") + ), + "nlp_log": json.dumps(answer), + "log_intent": [ + { + "intent": result["name"], + "is_default": result["name"] == answer["intent"]["name"], + "confidence": result["confidence"], + } + for result in answer.get("intent_ranking", []) + ], + } + }, + ) + log.start() return answer diff --git a/entrypoint.sh b/entrypoint.sh index 51d2e29..9e22f48 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,5 +2,4 @@ cd $WORKDIR #gunicorn bothub_nlp_api.wsgi --log-level debug --timeout 999999 -c gunicorn.conf.py -#gunicorn -k uvicorn.workers.UvicornWorker --timeout 999999 -c "gunicorn.conf.py" "bothub_nlp_api.app:app" -gunicorn -k uvicorn.workers.UvicornWorker --timeout 120 -c "gunicorn.conf.py" "bothub_nlp_api.app:app" +gunicorn -k uvicorn.workers.UvicornWorker --timeout 999999 -c "gunicorn.conf.py" "bothub_nlp_api.app:app"