gunicorn
gunicorn copied to clipboard
Gunicorn not running pre_request, post_request when using uvicorn worker
When pre/post request hooks were added, looks like they were added to sync.py
and async.py
and not the base worker code ... in 0d67447d198bea8521718ef4265128270d1f5476 (some refactoring since). Not sure whether config should be in common base or not ... but it looks like the Uvicorn worker is subclassing the base worker, so missing this functionality.
What's the fix here - make the Uvicorn worker subclass one of the workers with pre_request
support, or refactor in Gunicorn to push this config down into base?
i have the same question asgi pre_request post_request no working
When pre/post request hooks were added, looks like they were added to
sync.py
andasync.py
and not the base worker code ... in 0d67447 (some refactoring since). Not sure whether config should be in common base or not ... but it looks like the Uvicorn worker is subclassing the base worker, so missing this functionality.What's the fix here - make the Uvicorn worker subclass one of the workers with
pre_request
support, or refactor in Gunicorn to push this config down into base?
you maybe have used work-class,under these circumstances,the logs are placed at the lower for processing;for example,i work gunicorn+uvicorn,when i set work-class ,log-class not work; I hope to help you;
sorry I missed that ticket. I think the intention of this hooks is to ensure this is handled at the right time thois is why it ha s not been included in base_
class. Maybe we should revisit it that would make the writing of a worker easier?
Is it resolved yet? Because I believe I am facing the same issue here #3114
Same problem here.