0
0
Fork 0

Spawn FeedInsertWorker to deliver status into personal feed

This commit is contained in:
Eugen Rochko 2017-04-04 19:21:37 +02:00
parent 5f54981846
commit 6fd865c000
5 changed files with 39 additions and 25 deletions

View file

@ -0,0 +1,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