Opened 8 weeks ago
Closed 8 weeks ago
#36047 closed Bug (invalid)
`BaseConnectionHandler.close_all()` doesn't work with async clients
Description (last modified by ) ¶
hi
in django.core.cache there is this code:
caches = CacheHandler() def close_caches(**kwargs): # Some caches need to do a cleanup at the end of a request cycle. If not # implemented in a particular backend cache.close() is a no-op. caches.close_all()
where CacheHandler
is a subclass of BaseConnectionHandler
close_all()
looks like this:
def close_all(self): for conn in self.all(initialized_only=True): conn.close()
but when an async client is at work, .close()
doesn't work, it needs to be await conn.aclose()
note that in my case (django-valkey) there is no way for async clients to implement a sync method for close
p.s: i know django doesn't fully support async cache clients, i open this issue so the problem doesn't get lost
Change History (3)
comment:1 by , 8 weeks ago
Description: | modified (diff) |
---|
comment:2 by , 8 weeks ago
comment:3 by , 8 weeks ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Agreed, as we don't have support for async clients, this isn't a valid bug. I will link this to #33573 as I believe this was raised to be informational
Is this ticket actionable before Django supports async cache clients?