1
0
Fork 0
forked from fedi/mastodon
mastodon/app/workers/link_crawl_worker.rb
unarist 5c8ca024ef Improve error handling on LinkCrawlWorker (#5250)
* Improve error handling on LinkCrawlWorker

* Ignore TimeoutError and InvalidURIError too
* Record errors to debug log
* Enable dead job queue on LinkCrawlWorker

Since most of acceptable errors were already ignored, only our side issue should go to dead job queue.

* Ignore all http gem errors
2017-10-06 20:39:08 +02:00

14 lines
263 B
Ruby

# frozen_string_literal: true
class LinkCrawlWorker
include Sidekiq::Worker
sidekiq_options queue: 'pull', retry: 0
def perform(status_id)
FetchLinkCardService.new.call(Status.find(status_id))
rescue ActiveRecord::RecordNotFound
true
end
end