This PR simply moves the call to our process_image shell script from the Image model method process_image to a job, so it is run asynchronously as a background job when someone's uploading an image and ImageMagick is creating the sizes and uploading them to the image server.
The script itself "touches" the observation, so it seems to me that it doesn't need to report back to the UX.
[!IMPORTANT]
This is now available to be tested in a production environment on test.mushroomobserver.org, by creating obs there and checking that the images are created and uploaded to the image server.
Roadmap of PRs for making image scripts background jobs and rewriting them in ruby:
[x] Run process_image as a Solid Queue background job (this PR)
[ ] Run rotate_image as a Solid Queue background job, and broadcast the update from the Image model when done, updating the UX (like live comments)
[ ] Run retransfer_images as a Solid Queue cron job
[x] Rewrite all three scripts in Ruby as Image::Processor
coverage: 94.332% (-0.1%) from 94.434%
when pulling 8d27d442b7b66b189b1aa67b19f789d68d2f0239 on nimmo-image-scripts-to-job
into 15ec8fbe2dfcf033f31498fc13a8a677393ed706 on main.
This PR simply moves the call to our
process_image
shell script from the Image model methodprocess_image
to a job, so it is run asynchronously as a background job when someone's uploading an image and ImageMagick is creating the sizes and uploading them to the image server.Roadmap of PRs for making image scripts background jobs and rewriting them in ruby:
process_image
as a Solid Queue background job (this PR)rotate_image
as a Solid Queue background job, and broadcast the update from the Image model when done, updating the UX (like live comments)retransfer_images
as a Solid Queue cron jobImage::Processor