Class: ResqueWeb::FailuresController

Inherits:
ApplicationController show all
Defined in:
app/controllers/resque_web/failures_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#set_subtabs, subtabs

Instance Method Details

#destroyObject

remove an individual job from the failure queue



13
14
15
16
# File 'app/controllers/resque_web/failures_controller.rb', line 13

def destroy
  Resque::Failure.remove(params[:id])
  redirect_to failures_path(redirect_params)
end

#destroy_allObject

destroy all jobs from the failure queue



19
20
21
22
23
# File 'app/controllers/resque_web/failures_controller.rb', line 19

def destroy_all
  queue = params[:queue] || 'failed'
  Resque::Failure.clear(queue)
  redirect_to failures_path(redirect_params)
end

#indexObject

Display all jobs in the failure queue

Parameters:

  • params (Hash)


9
10
# File 'app/controllers/resque_web/failures_controller.rb', line 9

def index
end

#retryObject

retry an individual job from the failure queue



26
27
28
29
# File 'app/controllers/resque_web/failures_controller.rb', line 26

def retry
  reque_single_job(params[:id])
  redirect_to failures_path(redirect_params)
end

#retry_allObject

retry all jobs from the failure queue



32
33
34
35
36
37
38
39
# File 'app/controllers/resque_web/failures_controller.rb', line 32

def retry_all
  if params[:queue].present? && params[:queue]!="failed"
    Resque::Failure.requeue_queue(params[:queue])
  else
    (Resque::Failure.count-1).downto(0).each { |id| reque_single_job(id) }
  end
  redirect_to failures_path(redirect_params)
end