]> cat aescling's git repositories - mastodon.git/blob - app/workers/push_encrypted_message_worker.rb
Fix configuration for sidekiq-unique-jobs after 7.x upgrade (#15908)
[mastodon.git] / app / workers / push_encrypted_message_worker.rb
1 # frozen_string_literal: true
2
3 class PushEncryptedMessageWorker
4 include Sidekiq::Worker
5 include Redisable
6
7 def perform(encrypted_message_id)
8 encrypted_message = EncryptedMessage.find(encrypted_message_id)
9 message = InlineRenderer.render(encrypted_message, nil, :encrypted_message)
10 timeline_id = "timeline:#{encrypted_message.device.account_id}:#{encrypted_message.device.device_id}"
11
12 redis.publish(timeline_id, Oj.dump(event: :encrypted_message, payload: message, queued_at: (Time.now.to_f * 1000.0).to_i))
13 rescue ActiveRecord::RecordNotFound
14 true
15 end
16 end
This page took 0.070493 seconds and 5 git commands to generate.