~cytrogen/masto-fe

ref: 660993b415d928b45ae851b8e6d09d0e8af2f7f3 masto-fe/app/workers/distribution_worker.rb -rw-r--r-- 362 bytes
660993b4 — Matt Jankowski Add coverage for `URLValidator` (#25591) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class DistributionWorker
  include Sidekiq::Worker
  include Redisable
  include Lockable

  def perform(status_id, options = {})
    with_redis_lock("distribute:#{status_id}") do
      FanOutOnWriteService.new.call(Status.find(status_id), **options.symbolize_keys)
    end
  rescue ActiveRecord::RecordNotFound
    true
  end
end