barbeque 1.4.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cdb95733c48465dc1ded4986b0bbe415b84df84
4
- data.tar.gz: ff6688e7c2b6afabd31a7df9a4d0fd9fe70fd573
3
+ metadata.gz: c6b2851abd5afe48390d9cc74057bb8364b354fa
4
+ data.tar.gz: abd05db89ddd0ca3cdb0561741c9d480c667543c
5
5
  SHA512:
6
- metadata.gz: f7e3e84c1bc9a946d0906150c605835d3a9d42a2608a81859cb735275cd4a6b8586d233c05e3bef692b79589a97949c152fa6996ce5de0c545230b9f81bc8465
7
- data.tar.gz: 4e36ad0423d6713a879b875e72e24a0b8f3a8bd6bcdc230cfdc42bd7758bd62f611d9c96846e3e4de501079bffbb241a8988e6cb94130b25bf6a3b19bb7e98f4
6
+ metadata.gz: 353ff01f793a236c9bdaccdfdcf989b294fed731dfe753c81a4e0526cd83e28fda01fff881858dbb0725156cb71e8ee6886942936d13edadc28cf290fe7095cd
7
+ data.tar.gz: 03d100039d9f126275fd3bf7325d72a0d1a3d68f2bf4511dcd4c230e6c110f1280331f89ac8a3a8d8f74d682b0463e7c05baa7df10bd659d70ffb8718ce4135a
@@ -1,12 +1,21 @@
1
1
  class Barbeque::JobExecutionsController < Barbeque::ApplicationController
2
+ ID_REGEXP = /\A[0-9]+\z/
3
+
2
4
  def show
3
- @job_execution = Barbeque::JobExecution.find(params[:id])
5
+ if ID_REGEXP === params[:message_id]
6
+ job_execution = Barbeque::JobExecution.find_by(id: params[:message_id])
7
+ if job_execution
8
+ redirect_to(job_execution)
9
+ return
10
+ end
11
+ end
12
+ @job_execution = Barbeque::JobExecution.find_by!(message_id: params[:message_id])
4
13
  @log = @job_execution.execution_log
5
14
  @job_retries = @job_execution.job_retries.order(id: :desc)
6
15
  end
7
16
 
8
17
  def retry
9
- @job_execution = Barbeque::JobExecution.find(params[:job_execution_id])
18
+ @job_execution = Barbeque::JobExecution.find_by!(message_id: params[:job_execution_message_id])
10
19
  raise ActionController::BadRequest unless @job_execution.retryable?
11
20
 
12
21
  result = Barbeque::MessageRetryingService.new(message_id: @job_execution.message_id).run
@@ -1,9 +1,13 @@
1
1
  class Barbeque::JobRetriesController < Barbeque::ApplicationController
2
2
  def show
3
- @job_execution = Barbeque::JobExecution.find(params[:job_execution_id])
4
- @execution_log = @job_execution.execution_log
5
-
6
3
  @job_retry = Barbeque::JobRetry.find(params[:id])
4
+ @job_execution = @job_retry.job_execution
5
+
6
+ if params[:job_execution_message_id] != @job_execution.message_id
7
+ redirect_to([@job_execution, @job_retry])
8
+ end
9
+
10
+ @execution_log = @job_execution.execution_log
7
11
  @retry_log = @job_retry.execution_log
8
12
  end
9
13
  end
@@ -24,4 +24,8 @@ class Barbeque::JobExecution < Barbeque::ApplicationRecord
24
24
  def retryable?
25
25
  failed? || error?
26
26
  end
27
+
28
+ def to_param
29
+ message_id
30
+ end
27
31
  end
@@ -5,7 +5,7 @@
5
5
  %li= link_to('Home', root_path)
6
6
  %li= link_to(job_definition.app.name, app_path(job_definition.app.id))
7
7
  %li= link_to(job_definition.job, job_definition_path(job_definition.id))
8
- %li.active ##{@job_execution.id}
8
+ %li.active #{@job_execution.message_id}
9
9
 
10
10
  .row
11
11
  .col-sm-7
@@ -6,7 +6,7 @@
6
6
  %li= link_to('Home', root_path)
7
7
  %li= link_to(job_definition.app.name, app_path(job_definition.app.id))
8
8
  %li= link_to(job_definition.job, job_definition_path(job_definition.id))
9
- %li= link_to("##{job_execution.id}", job_execution_path(job_execution.id))
9
+ %li= link_to(job_execution.message_id, job_execution_path(job_execution))
10
10
  %li.active ##{@job_retry.id}
11
11
 
12
12
  .row
data/config/routes.rb CHANGED
@@ -8,7 +8,7 @@ Barbeque::Engine.routes.draw do
8
8
  get :execution_stats
9
9
  end
10
10
 
11
- resources :job_executions, only: :show do
11
+ resources :job_executions, only: :show, param: :message_id do
12
12
  post :retry
13
13
 
14
14
  resources :job_retries, only: :show
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '1.4.1'
2
+ VERSION = '2.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barbeque
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-05 00:00:00.000000000 Z
11
+ date: 2017-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adminlte2-rails