class RemoteFiles::ResqueJob

Public Class Methods

perform(options) click to toggle source
# File lib/remote_files/resque_job.rb, line 6
def self.perform(options)
  identifier = options.delete(:identifier) || options.delete("identifier")
  action     = options.delete(:_action)    || options.delete("_action")

  file = RemoteFiles::File.new(identifier, options)

  case action.to_sym
  when :synchronize
    file.synchronize!
  when :delete
    begin
      file.delete_now!
    rescue NotFoundError
    end
  else
    raise "unknown action #{action.inspect}"
  end
end