Spawn FeedInsertWorker to deliver status into personal feed
This commit is contained in:
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
|
Reference in New Issue
Block a user