Class: Workers::SendPrivate

Inherits:
SendBase show all
Defined in:
app/workers/send_private.rb

Constant Summary

Constants inherited from SendBase

Workers::SendBase::MAX_RETRIES

Instance Method Summary collapse

Instance Method Details

#perform(sender_id, obj_str, targets, retry_count = 0) ⇒ Object


5
6
7
8
9
10
11
12
13
# File 'app/workers/send_private.rb', line 5

def perform(sender_id, obj_str, targets, retry_count=0)
  targets_to_retry = DiasporaFederation::Federation::Sender.private(sender_id, obj_str, targets)

  return if targets_to_retry.empty?

  schedule_retry(retry_count + 1, sender_id, obj_str, targets_to_retry.keys) do |delay, new_retry_count|
    Workers::SendPrivate.perform_in(delay, sender_id, obj_str, targets_to_retry, new_retry_count)
  end
end