Fix bug where jobs had the opposite of the intended priority. Populating saved searches had the highest priority, while processing uploads had the lowest priority. Caused by Delayed::Job and GoodJob having opposite interpretations of job priorities. In Delayed::Job, lower numbers had higher priority, while in GoodJob, higher numbers have higher priority. This was missed when migrating from Delayed::Job to GoodJob.
14 lines
428 B
Ruby
14 lines
428 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ProcessUploadMediaAssetJob < ApplicationJob
|
|
queue_with_priority 20
|
|
|
|
def perform(upload_media_asset)
|
|
upload_media_asset.process_upload!
|
|
rescue Exception => e
|
|
# This should never happen. It will only happen if `process_upload!` raises an unexpected exception inside its own exception handler.
|
|
upload_media_asset.update!(status: :failed, error: e.message)
|
|
raise
|
|
end
|
|
end
|