Closed BradleyKirton closed 3 years ago
The order you now have it in makes more sense. Otherwise, the conn middleware might try to close the connections after a message, but then the admin middleware might get new ones. I'll fix the README.
@BradleyKirton @Bogdanp, I am confused.
@BradleyKirton you mention that if moving DbConnectionsMiddleware above the AdminMiddleware makes the connection disposal work. Then you list your "currently working" middleware block that shows DbConnectionsMiddleware below AdminMiddleware . Which of the two is the correct?
In our project, we currently use DbConnectionsMiddleware above AdminMiddleware (i.e. as currently shown in README.md) and still get the too many clients already error.
Hi there, first up thanks for creating dramatiq it's really a pleasure to work with.
I have a fairly new project which I have upgraded to Django 3.1.1 and I noticed that the database connections are not being disposed of after the tasks have finished. After some time I realised that if I move the DbConnectionsMiddleware above the AdminMiddleware then connections are correctly disposed of.
The middleware stack that is currently working for me looks like this:
Previously I had it like this:
Does this ordering matter? I would assume not since the default and documentation shows it like the latter.
I am not sure what the issue here could be as I have only noticed this now but as I mentioned I have recently upgraded django.
It is working fine for me now that I have switched the ordering but I thought I would bring this to your attention anyway.