[Fix] Add namespace check to async_delete_cache in Redis cache

Ensure key namespace is properly handled before deletion in async flow to maintain consistency with sync delete_cache method.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sotazhang 2025-12-04 17:12:59 +08:00
parent d1df4e838b
commit f1246c40c0

View file

@ -1260,6 +1260,7 @@ class RedisCache(BaseCache):
# typed as Any, redis python lib has incomplete type stubs for RedisCluster and does not include `delete`
_redis_client: Any = self.init_async_client()
# keys is str
key = self.check_and_fix_namespace(key=key)
return await _redis_client.delete(key)
def delete_cache(self, key):