mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 03:21:05 +00:00
Merge pull request #2149 from cincodenada/preview-generation-memory
Update preview image generation to only query ids
This commit is contained in:
commit
2993989d27
1 changed files with 10 additions and 5 deletions
|
@ -56,12 +56,17 @@ class Command(BaseCommand):
|
||||||
self.stdout.write(" OK 🖼")
|
self.stdout.write(" OK 🖼")
|
||||||
|
|
||||||
# Books
|
# Books
|
||||||
books = models.Book.objects.select_subclasses().filter()
|
book_ids = (
|
||||||
self.stdout.write(
|
models.Book.objects.select_subclasses()
|
||||||
" → Book preview images ({}): ".format(len(books)), ending=""
|
.filter()
|
||||||
|
.values_list("id", flat=True)
|
||||||
)
|
)
|
||||||
for book in books:
|
|
||||||
preview_images.generate_edition_preview_image_task.delay(book.id)
|
self.stdout.write(
|
||||||
|
" → Book preview images ({}): ".format(len(book_ids)), ending=""
|
||||||
|
)
|
||||||
|
for book_id in book_ids:
|
||||||
|
preview_images.generate_edition_preview_image_task.delay(book_id)
|
||||||
self.stdout.write(".", ending="")
|
self.stdout.write(".", ending="")
|
||||||
self.stdout.write(" OK 🖼")
|
self.stdout.write(" OK 🖼")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue