notifications-admin icon indicating copy to clipboard operation
notifications-admin copied to clipboard

`EventletTimeoutMiddleware`: wrap `application.wsgi_app`, get value from env var

Open risicle opened this issue 1 year ago • 0 comments

Wrapping application.wsgi_app is more correct than wrapping application itself, as it preserves flasky behaviours of the outer application object.

Also control the timeout time with a HTTP_SERVE_TIMEOUT_SECONDS config/env var that we can control from e.g. terraform, unifying this with the value we use for gunicorn's timeout (which has little effect on the eventlet worker_class, but controls a similar behaviour on non-async workers), with the intention we start to respect this across all our apps.

Also default to 30s is what we've decided to set our cloudfront timeouts to.

See also https://github.com/alphagov/notifications-api/pull/4219

Passes dev-a @ https://concourse.notify.tools/teams/dev-a/pipelines/deploy-notify/jobs/test/builds/53

risicle avatar Oct 11 '24 15:10 risicle