worker-class parameter accepts class additionally to class path
I have a FastAPI application running on gunicorn with the use of uvicorn workers. I am creating my own custom uvicorn worker because i need to pass specific config parameters to uvicorn that are managed by a central config.yml file by application managers. What i want to do is pass the defined class to the "worker-class" parameter of the gunicorn config and not the class path. This would allow me to define my class inside the function that calls the gunicorn application and also has access to all config parameters.
After investigating the code i found out that actually the util.load_class function has the possibility to distinguish between class and class path (which is str) and return the class. The problem lies in the config module and the properties "worker_class" and "worker_class_str". A simple check about the type of the uri would be enough for the application to start properly with the given class.
i created a pull request with a fix for this issue and would appreciate it if you guys could have a look.
It looks like you created a branch but I don't see a PR. Can you open a PR and I can take a look, please?
Oh, I'm sorry, I found it at #3079.
i don't see any pull request there... did you close it?
No i didn't. I already got one review and I think I need one more in order for the PR to be merged. I didn't change anything.
Benoit Chesneau @.***> schrieb am Di., 6. Aug. 2024, 22:42:
i don't see any pull request there... did you close it?
— Reply to this email directly, view it on GitHub https://github.com/benoitc/gunicorn/issues/3079#issuecomment-2272017943, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSC4O447QSNUYJDBDRHMHTZQERL3AVCNFSM6AAAAABMC7Q72WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZSGAYTOOJUGM . You are receiving this because you authored the thread.Message ID: @.***>
@odyfatouros i only see code in your repo. Can you point me to the PR?
Here it is https://github.com/benoitc/gunicorn/pull/3080
Benoit Chesneau @.***> schrieb am Mi., 7. Aug. 2024, 01:33:
@odyfatouros https://github.com/odyfatouros i only see code in your repo. Can you point me to the PR?
— Reply to this email directly, view it on GitHub https://github.com/benoitc/gunicorn/issues/3079#issuecomment-2272262543, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSC4O3WSSCLDH4VL7YDQYTZQFFKRAVCNFSM6AAAAABMC7Q72WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZSGI3DENJUGM . You are receiving this because you were mentioned.Message ID: @.***>
applied thanks.