etesync-server/etebase_fastapi
Tom Hacohen 5b8f667e55 Cleanup django db connections before every request and every dependency.
This is instead of the commit we reverted in the previous commit.
The problem is that django keeps the connection per thread and it relies
on django itself to clean them up before/after connections.
We can't do this, because django is unaware of fastapi, so we have to
manage this ourselves.

The easiest way is to call it at the beginning of evenry route and every dep.
We need to do it for each because unfortunately fastapi may send them to
different worker threads.
2020-12-30 17:16:58 +02:00
..
routers Remove unused variable. 2020-12-30 13:55:05 +02:00
sendfile Reformat files using black. 2020-12-29 15:37:11 +02:00
__init__.py first commit 2020-12-27 20:32:09 +02:00
db_hack.py Cleanup django db connections before every request and every dependency. 2020-12-30 17:16:58 +02:00
dependencies.py Fix many type errors. 2020-12-29 13:32:19 +02:00
exceptions.py Cleanup validation errors. 2020-12-28 17:39:51 +02:00
main.py Revert "Add a django middleware to cleanup db connections." 2020-12-30 15:37:59 +02:00
msgpack.py Cleanup django db connections before every request and every dependency. 2020-12-30 17:16:58 +02:00
stoken_handler.py Remove usages of EtebaseValidationError. 2020-12-28 10:45:34 +02:00
utils.py Improve typing information. 2020-12-29 18:17:28 +02:00