Class: Workers::ReceivePrivate

Inherits:
ReceiveBase show all
Defined in:
app/workers/receive_private.rb

Instance Method Summary collapse

Methods inherited from ReceiveBase

#filter_errors_for_retry

Instance Method Details

#perform(user_id, data, legacy) ⇒ Object


9
10
11
12
13
14
15
# File 'app/workers/receive_private.rb', line 9

def perform(user_id, data, legacy)
  filter_errors_for_retry do
    user_private_key = User.where(id: user_id).pluck(:serialized_private_key).first
    rsa_key = OpenSSL::PKey::RSA.new(user_private_key)
    DiasporaFederation::Federation::Receiver.receive_private(data, rsa_key, user_id, legacy)
  end
end