Skip to content

Commit

Permalink
fix(46): Redis Cache errors if delete_many called with empty arr
Browse files Browse the repository at this point in the history
  • Loading branch information
TrangPham committed Mar 28, 2023
1 parent 879198e commit 11371a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions admin_confirm/file_cache.py
Expand Up @@ -106,5 +106,9 @@ def delete(self, key):

def delete_all(self):
"Delete all cached file data from cache."
self.cache.delete_many(self.cached_keys)
self.cached_keys = []
# Issue #46 Redis Cache errs if we call delete_many with an empty list - fixed in Django 4.2
# Note: set_many() should check for empty data in redis too.
# See: https://github.com/django/django/commit/608ab043f75f1f9c094de57d2fd678f522bb8243
if self.cached_keys:
self.cache.delete_many(self.cached_keys)
self.cached_keys = []

0 comments on commit 11371a2

Please sign in to comment.