Module: Sidekiq::Belt::Community::RunJob::SidekiqRunJob

Defined in:
lib/sidekiq/belt/community/run_job.rb

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/sidekiq/belt/community/run_job.rb', line 52

def self.registered(app)
  app.get("/run_jobs") do
    @jobs = Sidekiq::Belt::Community::RunJob.list_grouped_jobs

    render(:erb, File.read(File.join(__dir__, "views/run_jobs.erb")))
  end

  app.post("/run_jobs/:rjid/run") do
    args = url_params("args")

    Sidekiq::Belt::Community::RunJob.run_job(route_params(:rjid).to_i, args)

    return redirect "#{root_path}run_jobs"
  end
end