Spawn FeedInsertWorker to deliver status into personal feed
This commit is contained in:
parent
5f54981846
commit
6fd865c000
5 changed files with 39 additions and 25 deletions
15
app/workers/feed_insert_worker.rb
Normal file
15
app/workers/feed_insert_worker.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue