diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-04 19:21:37 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-04 19:21:37 +0200 |
commit | 6fd865c0004efbf11ee87c06fea9f48af567fabe (patch) | |
tree | cbb9e0c86c65ea27e5d11c317f71e826c790af65 /app/workers | |
parent | 5f54981846508daf9558f66ffd70d42d8213bea9 (diff) |
Spawn FeedInsertWorker to deliver status into personal feed
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/feed_insert_worker.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/workers/feed_insert_worker.rb b/app/workers/feed_insert_worker.rb new file mode 100644 index 000000000..a58dfaa74 --- /dev/null +++ b/app/workers/feed_insert_worker.rb @@ -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 |