Skip to content

Commit

Permalink
Merge pull request #135 from weni-ai/v3.3.2
Browse files Browse the repository at this point in the history
Revert slow api issues once its not a problem anymore
  • Loading branch information
johncordeiro authored Sep 4, 2023
2 parents 495ff47 + c76299c commit a840a49
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
48 changes: 24 additions & 24 deletions bothub_nlp_api/handlers/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a840a49

Please sign in to comment.