Skip to content

Commit

Permalink
fix(46): Redis Cache errors if delete_many called with empty arr (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrangPham authored Mar 29, 2023
1 parent 76e96c3 commit f481be1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions admin_confirm/file_cache.py
Original file line number Diff line number Diff line change
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 f481be1

Please sign in to comment.