Class: Workers::ExportUser

Inherits:
Base
  • Object
show all
Includes:
Diaspora::Logging
Defined in:
app/workers/export_user.rb

Instance Method Summary collapse

Instance Method Details

#perform(user_id) ⇒ Object


13
14
15
16
17
18
19
20
21
# File 'app/workers/export_user.rb', line 13

def perform(user_id)
  if currently_running_exports >= AppConfig.settings.export_concurrency.to_i
    logger.info "Already the maximum number of parallel user exports running, " \
                "scheduling export for User:#{user_id} in 5 minutes."
    self.class.perform_in(5.minutes + rand(30), user_id)
  else
    export_user(user_id)
  end
end