Class: LatoCms::GenerateVideoPosterJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/lato_cms/generate_video_poster_job.rb

Overview

Generates the poster image for a video Media in the background so the upload request is not blocked by ffmpeg processing. Runs once per Media (not per field usage), since the same video can be referenced by many fields. Failures are swallowed by the model (logged as warnings): a missing poster must never break the video.

Instance Method Summary collapse

Instance Method Details

#perform(media_id) ⇒ Object



10
11
12
# File 'app/jobs/lato_cms/generate_video_poster_job.rb', line 10

def perform(media_id)
  LatoCms::Media.find_by(id: media_id)&.generate_video_poster!
end