mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 09:31:08 +00:00
consolidate multiple cache.delete() calls into cache.delete_many()
This commit is contained in:
parent
acae063652
commit
29f852b57e
1 changed files with 6 additions and 2 deletions
|
@ -551,8 +551,12 @@ class Edition(Book):
|
|||
|
||||
# clear author cache
|
||||
if self.id:
|
||||
for author_id in self.authors.values_list("id", flat=True):
|
||||
cache.delete(f"author-books-{author_id}")
|
||||
cache.delete_many(
|
||||
[
|
||||
f"author-books-{author_id}"
|
||||
for author_id in self.authors.values_list("id", flat=True)
|
||||
]
|
||||
)
|
||||
|
||||
@transaction.atomic
|
||||
def repair(self):
|
||||
|
|
Loading…
Reference in a new issue