Commit graph

10 commits

Author SHA1 Message Date
Joel Bradshaw 7f5d47a36f Use values_list with flat, yay! 2022-06-07 23:15:34 -07:00
Joel Bradshaw b744ff7836 Run black 2022-06-05 13:40:01 -07:00
Joel Bradshaw 482005f304 Update preview image generation to only query ids
Previously we were querying the full book objects just to get a list of
id's, which is much slower and also takes a lot more memory, which can
cause the process to be killed on memory-limited machines with a large
number of books.

Instead, since we're just dispatching jobs here, we can just ask for the
id's, which is faster and much more practical memory-wise.

The map is a little annoying, I didn't see a way to directly get just a
list of the value of one field, so we have to get a list of
dictionairies with one key and then pull that key out. Whatevs.
2022-06-05 13:07:44 -07:00
Mouse Reeve ed536e6b41 Adds command to get admin code 2022-02-17 10:59:28 -08:00
Mouse Reeve 59938e2d46 Linter fixes for models 2021-06-18 15:24:10 -07:00
Mouse Reeve d8d6f57373 Linting fixes for preview image code 2021-06-18 15:08:36 -07:00
Joachim 08cebd7051 Lint 2021-05-28 17:26:43 +02:00
Joachim 61367c3f4f Protect generate_preview_images command
- add `--all` argument
- send computation intensive tasks to Celery
2021-05-28 17:25:20 +02:00
Joachim eb56cced8d Lint 2021-05-26 14:46:34 +02:00
Joachim 65de40a95a Add generate_preview_images command 2021-05-26 13:52:10 +02:00