From 29f852b57e5cdfec2184e498c30fe7537e027572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Fri, 26 Apr 2024 15:36:11 -0300 Subject: [PATCH] consolidate multiple cache.delete() calls into cache.delete_many() --- bookwyrm/models/book.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index 2e6377575..4ff377dbb 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -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):