about summary refs log tree commit diff
path: root/app/workers/feed_insert_worker.rb
blob: a58dfaa74cb027e297d09e290c6b7d7d372e2ddf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class FeedInsertWorker
  include Sidekiq::Worker

  def perform(status_id, follower_id)
    status   = Status.find(status_id)
    follower = Account.find(follower_id)

    return if FeedManager.instance.filter?(:home, status, follower.id)
    FeedManager.instance.push(:home, follower, status)
  rescue ActiveRecord::RecordNotFound
    true
  end
end