From the source:
> The providing_args argument is deprecated. As it is purely
> documentational, it has no replacement. If you rely on this
> argument as documentation, you can move the text to a code
> comment or docstring.
self.redis isn't None, it's actually unset, so accessing it results
in an exception:
```
ERROR: Traceback (most recent call last):
File "./.venv/lib/python3.9/site-packages/starlette/routing.py", line 624, in lifespan
await receive()
File "./.venv/lib/python3.9/site-packages/starlette/routing.py", line 521, in __aexit__
await self._router.shutdown()
File "./.venv/lib/python3.9/site-packages/starlette/routing.py", line 608, in shutdown
await handler()
File "./etebase_fastapi/main.py", line 72, in on_shutdown
await redisw.close()
File "./etebase_fastapi/redis.py", line 18, in close
if self.redis is not None:
AttributeError: 'RedisWrapper' object has no attribute 'redis'
```
This one is to fix my own PR #125, the requirement files contained the following sentence:
"To update, run: pip-compile --output-file=requirements.txt requirements.in/base.txt"
But that was misleading, after reading pip-tools documentation I found that
"If pip-compile finds an existing requirements.txt file that fulfils the dependencies then no changes will be made, even if updates are available."
That was my mistake, generated the files again and made new builds using python 3.10 that worked as expected. Once again sorry for the mistake!
This strips the port from the client requests, comparing only the hostnames or IP addresses, and should alleviate nonstandard port and initial testing issues. Tested on Linux, Mac, and Android clients. Closes#105.
Code is from this comment:
https://github.com/etesync/server/issues/66#issuecomment-731215345
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.
This ended up being useless because of the way startlette and fastapi do
thread pools. The middleware is called in one thread, the path in
another, and the dependency in yet another.
This reverts commit 473448246f.
The code uses the django ORM which is sync, and fastapi handles sync paths
just fine. So having all of this extra code for handling async was unnecessary.