To avoid the problem of having confusing defaults, the postage is now
set explicitly on every template.
Putting the postage ‘inside’ the letter template makes the interaction
for changing it consistent with how other parts of the template are
added.
Plus everyone loves skeumorphism.
We’re now serving assets from S3 when running on PaaS. So we’ll set
the appropriate caching headers there or in Cloudfront. This means that
the app no longer needs to serve cache headers, which is what we were
using WhiteNoise for.
This commits removes WhiteNoise in favour of letting Flask handle the
serving of static assets.
Bumped the notifications-utils version. The `gmt_timezones` function in
this repo and the `utc_string_to_aware_gmt_datetime` in
notifications-utils are the same, so have updated the code to always use
the version in utils.
This commit adds logic to:
- take the list of selected folders and templates
- split it into two lists (of folders and templates)
- `POST` that data to the API, to effect the movement of said folders
and templates
I’ve tried to architect it in such a way that we can easily add more
template ‘operations’ in the future, as we add more forms to the choose
template page.
According to gunicorn `timeout` docs, async workers shouldn't be
terminated after the request time exceeds the specified timeout
as long as the worker process is still communicating.
This makes sense for async workers since they generally don't
block other requests from processing.
This is the behaviour we've seen on notifications-api - requests
can sometimes take much longer than the default 30 second timeout
and still succeed.
For the admin app however gunicorn has been shutting down workers
after 30s with `[CRITICAL] WORKER TIMEOUT`. This results in a 502
response from the admin app. Most of these requests fail because
the underlying requests to the api is taking longer than 30 seconds,
however we haven't seen this in the logs originally since unlike
the admin app, api requests succeed (even though their response is
no longer needed).
This seems like a bug in newer versions of gunicorn, downgrading
it to the version that the api is currently using solves the problem
by allowing admin requests to take longer than 30 seconds.
(Tested by trying requests with a `time.sleep(30)` locally).
It's not clear what exactly the bug in gunicorn is, but this also
potentially unblocks eventlet workers and allows them to process
more than one request at a time.