diff --git a/Gemfile.lock b/Gemfile.lock index 65b6b86..b49d3b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -197,6 +197,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 DEPENDENCIES panoptic! diff --git a/app/controllers/panoptic/jobs/retries_controller.rb b/app/controllers/panoptic/jobs/retries_controller.rb new file mode 100644 index 0000000..6b9f271 --- /dev/null +++ b/app/controllers/panoptic/jobs/retries_controller.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Panoptic + class Jobs::RetriesController < ApplicationController + def create + @job = SolidQueue::Job.find(params[:job_id]) + + @job.retry + redirect_to jobs_path, notice: "Successfully retried Job ##{@job.id}" + end + end +end diff --git a/app/views/layouts/panoptic/application.html.erb b/app/views/layouts/panoptic/application.html.erb index 7a6420e..ac5e1ff 100644 --- a/app/views/layouts/panoptic/application.html.erb +++ b/app/views/layouts/panoptic/application.html.erb @@ -1,19 +1,26 @@ -
-diff --git a/config/routes.rb b/config/routes.rb index 273f0dc..4b54227 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,12 +3,12 @@ resources :queues, only: [:index] - scope "jobs" do - get "all", to: "jobs#index", as: "jobs" + resources :jobs, only: :index do + resource :retry, only: :create, module: :jobs + end - scope module: "jobs" do - resources :scheduled, only: :index, as: :scheduled_jobs - resources :failed, only: [:index, :show], as: :failed_jobs - end + scope module: :jobs do + resources :scheduled, only: :index, as: :scheduled_jobs + resources :failed, only: [:index, :show], as: :failed_jobs end end