* Initial work to expand detection functionality * Finish up functionality and tests * Fix class name * Fix tests * Update spec/services/articles/enrich_image_attributes_spec.rb Co-authored-by: Michael Kohl <citizen428@forem.com> * Update spec/services/articles/enrich_image_attributes_spec.rb Co-authored-by: Michael Kohl <citizen428@forem.com>
17 lines
419 B
Ruby
17 lines
419 B
Ruby
module Articles
|
|
class EnrichImageAttributesWorker
|
|
include Sidekiq::Worker
|
|
|
|
sidekiq_options queue: :medium_priority, retry: 5, lock: :until_executing
|
|
|
|
def perform(article_id)
|
|
article = Article.find_by(id: article_id)
|
|
return unless article
|
|
|
|
detected = Articles::EnrichImageAttributes.call(article)
|
|
return unless detected
|
|
|
|
EdgeCache::BustArticle.call(article)
|
|
end
|
|
end
|
|
end
|