Django with uwsgi(multiple progress and multiple threading): How to run a function when server exits?
As of grpcio 0.15.0 clients no longer need to be closed.
I am writing a Django project with uwsgi(multiple progress and multiple threading mode) using grpc.
Right now, when the server exits, the grpc python client can not be closed because it used threading and rewrite the exit function. so I have to make a clean function to close the grpc client when the uwsgi sever is reload or exit, and I wish to organise it so that this function is called automatically when the server quits.
Any help would be greatly appreciated.