~cytrogen/masto-fe

ref: f05effeb8fb8f2cc09ccfdbff2e670ff5cb23e9f masto-fe/app/workers/unpublish_announcement_worker.rb -rw-r--r-- 414 bytes
f05effeb — Stanislas Signoud [Glitch] Fix a missing redirection on getting-started in multi column mode 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

class UnpublishAnnouncementWorker
  include Sidekiq::Worker
  include Redisable

  def perform(announcement_id)
    payload = Oj.dump(event: :'announcement.delete', payload: announcement_id.to_s)

    FeedManager.instance.with_active_accounts do |account|
      redis.publish("timeline:#{account.id}", payload) if redis.exists?("subscribed:timeline:#{account.id}")
    end
  end
end