Skip to content

Commit

Permalink
use gevent in gunicorn for sse
Browse files Browse the repository at this point in the history
  • Loading branch information
tobru committed Jun 1, 2024
1 parent 0c71423 commit 5c365b7
Show file tree
Hide file tree
Showing 4 changed files with 304 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.podstatus
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ COPY nginx.conf /etc/nginx/nginx.conf

EXPOSE 8080

CMD ["sh", "-c", "nginx && gunicorn conferenceli.app:app"]
CMD ["sh", "-c", "nginx && gunicorn -k gevent conferenceli.app:app"]
7 changes: 6 additions & 1 deletion podstatus/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ def chaos():
if pods:
pod = random.choice(pods)
pod_name = pod.metadata.name
v1.delete_namespaced_pod(pod_name, namespace)
try:
v1.delete_namespaced_pod(pod_name, namespace)
logging.info(f"Chaos monkey deleted pod {pod_name}")
except ApiException as e:
logging.error(f"Chaos monkey couldn't delete pod {pod_name} because {e}")
return jsonify({"message": f"Deleting of {pod_name} failed"}), 500
return jsonify({"message": f"Pod {pod_name} deleted"}), 200
else:
return jsonify({"message": "No pods available to delete"}), 404
Expand Down
Loading

0 comments on commit 5c365b7

Please sign in to comment.