fengsp / django-grpc-framework

gRPC for Django.
https://djangogrpcframework.readthedocs.io/
Apache License 2.0
390 stars 52 forks source link

Unnecessary invoking db.close_old_connections() causes test case failed #6

Open siriuslan opened 4 years ago

siriuslan commented 4 years ago

I hit problem with test case failed and complaining - exception is connection already closed.

I fix this issue by removing invoking db.close_old_connections() in Servicer's handler() before the try block. Django manages database connection by itself(https://docs.djangoproject.com/en/3.1/ref/databases/#connection-management) and to me it's not necessary to invoke that manually.