resque-job_history 0.0.9 → 0.0.10

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: a1bcddf23e0810a21b31ff619ee1c7a5c5f11974
4
- data.tar.gz: 2dff8784d8d962f84b3ce2c9cc197ca52f6fad9d
3
+ metadata.gz: 611450a862256e5adff163fdc1932b60ccb780af
4
+ data.tar.gz: 1873bbabe72e49820c3d43697fac5940840de034
5
5
  SHA512:
6
- metadata.gz: 9bd5e7b212eef1755b55b2e2d069727fd79634c5356eca014b451dbf06f525e4280aa5ddd96ee32b63c47a17db68227bb09829560c17d19861476f79198c8093
7
- data.tar.gz: d8c0b165e02196b451a9bf5066376841670a96300aaff547cb796eb1de8b95cee1f71b083d2a8f9d2920896a569003ae3d74efadb12cb1871717339172c37b0c
6
+ metadata.gz: d38f13b928d53a355148ad45e53cbf2205589ed8078b50220d40aac6aa29045369279880a5da339dde7820b3c32edf1aeb266c5788e158cee1229f0133b79da5
7
+ data.tar.gz: d0527dca6d0b41b1e9126dda7f27ef61b92d26b62f67884b5453cee72b93c80be2547c16d717235312737872e9e06852a5b1c0435b54236a9656e6d588fb869a
@@ -3,6 +3,8 @@
3
3
  require "resque"
4
4
  require "resque/server"
5
5
  require "resque-job_history"
6
+ require "action_view/helpers/output_safety_helper"
7
+ require "action_view/helpers/capture_helper"
6
8
  require "action_view/helpers/date_helper"
7
9
 
8
10
  module Resque
@@ -136,6 +138,7 @@ module Resque
136
138
 
137
139
  def add_button_callbacks(base)
138
140
  purge_all(base)
141
+ purge_linear_history(base)
139
142
  purge_class(base)
140
143
  retry_job(base)
141
144
  delete_job(base)
@@ -192,6 +195,16 @@ module Resque
192
195
  end
193
196
  end
194
197
  end
198
+
199
+ def purge_linear_history(base)
200
+ base.class_eval do
201
+ post "/job history/purge_linear_history" do
202
+ Resque::Plugins::JobHistory::Cleaner.purge_linear_history
203
+
204
+ redirect u("job history")
205
+ end
206
+ end
207
+ end
195
208
  end
196
209
 
197
210
  Resque::Server.tabs << "Job History"
@@ -55,6 +55,21 @@ module Resque
55
55
  end
56
56
  end
57
57
 
58
+ def purge_linear_history
59
+ linear_jobs = Resque::Plugins::JobHistory::JobList.new.linear_jobs
60
+
61
+ fixup_linear_keys
62
+
63
+ linear_jobs.job_ids.each do |job_id|
64
+ linear_jobs.remove_job(job_id)
65
+ end
66
+
67
+ list_keys = redis.keys("job_history..*")
68
+ list_keys.each do |key|
69
+ del_key(key, "Purging unknown linear history key")
70
+ end
71
+ end
72
+
58
73
  def purge_invalid_jobs
59
74
  job_classes.each do |class_name|
60
75
  next if Resque::Plugins::JobHistory::HistoryDetails.new(class_name).class_name_valid?
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/hash"
4
+
3
5
  module Resque
4
6
  module Plugins
5
7
  module JobHistory
@@ -56,8 +56,11 @@ module Resque
56
56
  :num_finished_jobs,
57
57
  :total_finished_jobs,
58
58
  :total_run_jobs,
59
- :max_concurrent_jobs
59
+ :max_concurrent_jobs,
60
+ :total_failed_jobs
60
61
  job_details.public_send sort_key
62
+ when :class_name_valid?
63
+ job_details.class_name_valid? ? 1 : 0
61
64
  else
62
65
  last_run_sort_value(job_details.last_run, sort_key)
63
66
  end
@@ -66,13 +69,25 @@ module Resque
66
69
  def last_run_sort_value(last_run, sort_key)
67
70
  case sort_key.to_sym
68
71
  when :start_time
69
- last_run.start_time || Time.now
72
+ last_run_start_time_sort(last_run)
70
73
  when :duration
71
- last_run.duration
74
+ last_run_duration_sort(last_run)
72
75
  when :success
73
- last_run.succeeded? ? 1 : 0
76
+ last_run_succeeded_sort(last_run)
74
77
  end
75
78
  end
79
+
80
+ def last_run_succeeded_sort(last_run)
81
+ last_run.try(:succeeded?) ? 1 : 0
82
+ end
83
+
84
+ def last_run_duration_sort(last_run)
85
+ last_run.try(:duration) || 100.years
86
+ end
87
+
88
+ def last_run_start_time_sort(last_run)
89
+ last_run.try(:start_time) || Time.now
90
+ end
76
91
  end
77
92
  end
78
93
  end
@@ -3,7 +3,7 @@
3
3
  module Resque
4
4
  module Plugins
5
5
  module JobHistory
6
- VERSION = "0.0.9"
6
+ VERSION = "0.0.10"
7
7
  end
8
8
  end
9
9
  end
@@ -9,19 +9,19 @@
9
9
 
10
10
  <% if total_pages > 1 %>
11
11
  <div class="job_history_prev_links">
12
- <a href="job%20history?<%= { sort: @sort_by,
13
- page_size: page_size,
14
- page_num: 1,
15
- order: @sort_order }.to_param %>"
12
+ <a href="<%= u("job history") %>?<%= { sort: @sort_by,
13
+ page_size: page_size,
14
+ page_num: 1,
15
+ order: @sort_order }.to_param %>"
16
16
  class="job_history_first_page"
17
17
  disabled="<%= first_page > 1 %>">
18
18
  &lt;&lt; First
19
19
  </a>
20
20
 
21
- <a href="job%20history?<%= { sort: @sort_by,
22
- page_size: page_size,
23
- page_num: [1, page_num - 1].max,
24
- order: @sort_order }.to_param %>"
21
+ <a href="<%= u("job history") %>?<%= { sort: @sort_by,
22
+ page_size: page_size,
23
+ page_num: [1, page_num - 1].max,
24
+ order: @sort_order }.to_param %>"
25
25
  class="job_history_prev_page"
26
26
  disabled="<%= page_num > 1 %>">
27
27
  &lt; Prev
@@ -31,10 +31,10 @@
31
31
  <div class="job_history_pages">
32
32
  <% (first_page..last_page).each do |page_number| %>
33
33
  <% if page_number != page_num %>
34
- <a href="job%20history?<%= { sort: @sort_by,
35
- page_size: page_size,
36
- page_num: page_number,
37
- order: @sort_order }.to_param %>"
34
+ <a href="<%= u("job history") %>?<%= { sort: @sort_by,
35
+ page_size: page_size,
36
+ page_num: page_number,
37
+ order: @sort_order }.to_param %>"
38
38
  class="job_history_page">
39
39
  <%= page_number %>
40
40
  </a>
@@ -45,19 +45,19 @@
45
45
  </div>
46
46
 
47
47
  <div class="job_history_next_links">
48
- <a href="job%20history?<%= { sort: @sort_by,
49
- page_size: page_size,
50
- page_num: [total_pages, page_num + 1].min,
51
- order: @sort_order }.to_param %>"
48
+ <a href="<%= u("job history") %>?<%= { sort: @sort_by,
49
+ page_size: page_size,
50
+ page_num: [total_pages, page_num + 1].min,
51
+ order: @sort_order }.to_param %>"
52
52
  class="job_history_next_page"
53
53
  disabled="<%= page_num < last_page %>">
54
54
  Next &gt;
55
55
  </a>
56
56
 
57
- <a href="job%20history?<%= { sort: @sort_by,
58
- page_size: page_size,
59
- page_num: total_pages,
60
- order: @sort_order }.to_param %>"
57
+ <a href="<%= u("job history") %>?<%= { sort: @sort_by,
58
+ page_size: page_size,
59
+ page_num: total_pages,
60
+ order: @sort_order }.to_param %>"
61
61
  class="job_history_last_page"
62
62
  disabled="<%= last_page < total_pages %>">
63
63
  Last &gt;&gt;
@@ -9,21 +9,23 @@
9
9
 
10
10
  <% if total_pages > 1 %>
11
11
  <div class="job_history_prev_links">
12
- <a href="job_class_details?<%= { class_name: class_name,
13
- "#{primary_type}_page_size" => page_size,
14
- "#{primary_type}_page_num" => 1,
15
- "#{secondary_type}_page_size" => secondary_page_size,
16
- "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
12
+ <a href="<%= u("job history/job_class_details") %>?<%=
13
+ { class_name: class_name,
14
+ "#{primary_type}_page_size" => page_size,
15
+ "#{primary_type}_page_num" => 1,
16
+ "#{secondary_type}_page_size" => secondary_page_size,
17
+ "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
17
18
  class="job_history_first_page"
18
19
  disabled="<%= first_page > 1 %>">
19
20
  &lt;&lt; First
20
21
  </a>
21
22
 
22
- <a href="job_class_details?<%= { class_name: class_name,
23
- "#{primary_type}_page_size" => page_size,
24
- "#{primary_type}_page_num" => [1, page_num - 1].max,
25
- "#{secondary_type}_page_size" => secondary_page_size,
26
- "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
23
+ <a href="<%= u("job history/job_class_details") %>?<%=
24
+ { class_name: class_name,
25
+ "#{primary_type}_page_size" => page_size,
26
+ "#{primary_type}_page_num" => [1, page_num - 1].max,
27
+ "#{secondary_type}_page_size" => secondary_page_size,
28
+ "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
27
29
  class="job_history_prev_page"
28
30
  disabled="<%= page_num > 1 %>">
29
31
  &lt; Prev
@@ -33,11 +35,12 @@
33
35
  <div class="job_history_pages">
34
36
  <% (first_page..last_page).each do |page_number| %>
35
37
  <% if page_number != page_num %>
36
- <a href="job_class_details?<%= { class_name: class_name,
37
- "#{primary_type}_page_size" => page_size,
38
- "#{primary_type}_page_num" => page_number,
39
- "#{secondary_type}_page_size" => secondary_page_size,
40
- "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
38
+ <a href="<%= u("job history/job_class_details") %>?<%=
39
+ { class_name: class_name,
40
+ "#{primary_type}_page_size" => page_size,
41
+ "#{primary_type}_page_num" => page_number,
42
+ "#{secondary_type}_page_size" => secondary_page_size,
43
+ "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
41
44
  class="job_history_page">
42
45
  <%= page_number %>
43
46
  </a>
@@ -48,21 +51,23 @@
48
51
  </div>
49
52
 
50
53
  <div class="job_history_next_links">
51
- <a href="job_class_details?<%= { class_name: class_name,
52
- "#{primary_type}_page_size" => page_size,
53
- "#{primary_type}_page_num" => [total_pages, page_num + 1].min,
54
- "#{secondary_type}_page_size" => secondary_page_size,
55
- "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
54
+ <a href="<%= u("job history/job_class_details") %>?<%=
55
+ { class_name: class_name,
56
+ "#{primary_type}_page_size" => page_size,
57
+ "#{primary_type}_page_num" => [total_pages, page_num + 1].min,
58
+ "#{secondary_type}_page_size" => secondary_page_size,
59
+ "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
56
60
  class="job_history_next_page"
57
61
  disabled="<%= page_num < last_page %>">
58
62
  Next &gt;
59
63
  </a>
60
64
 
61
- <a href="job_class_details?<%= { class_name: class_name,
62
- "#{primary_type}_page_size" => page_size,
63
- "#{primary_type}_page_num" => total_pages,
64
- "#{secondary_type}_page_size" => secondary_page_size,
65
- "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
65
+ <a href="<%= u("job history/job_class_details") %>?<%=
66
+ { class_name: class_name,
67
+ "#{primary_type}_page_size" => page_size,
68
+ "#{primary_type}_page_num" => total_pages,
69
+ "#{secondary_type}_page_size" => secondary_page_size,
70
+ "#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
66
71
  class="job_history_last_page"
67
72
  disabled="<%= last_page < total_pages %>">
68
73
  Last &gt;&gt;
@@ -23,7 +23,8 @@
23
23
  <% jobs.each do |job_details| %>
24
24
  <tr<%= job_details.succeeded? ? "" : " class=\"job_history_error\"" %>>
25
25
  <td>
26
- <a href="job_details?class_name=<%= job_details.class_name %>&job_id=<%= job_details.job_id %>">
26
+ <a href="<%= u("job history/job_details") %>?class_name=<%=
27
+ job_details.class_name %>&job_id=<%= job_details.job_id %>">
27
28
  <% if job_details.start_time %>
28
29
  <%= time_ago_in_words(job_details.start_time) %> ago
29
30
  (<%= job_details.start_time %>)
@@ -9,15 +9,17 @@
9
9
 
10
10
  <% if total_pages > 1 %>
11
11
  <div class="job_history_prev_links">
12
- <a href="linear_history?<%= { "page_size" => page_size,
13
- "page_num" => 1 }.to_param %>"
12
+ <a href="<%= u("job history/linear_history") %>?<%=
13
+ { "page_size" => page_size,
14
+ "page_num" => 1 }.to_param %>"
14
15
  class="job_history_first_page"
15
16
  disabled="<%= first_page > 1 %>">
16
17
  &lt;&lt; First
17
18
  </a>
18
19
 
19
- <a href="linear_history?<%= { "page_size" => page_size,
20
- "page_num" => [1, page_num - 1].max }.to_param %>"
20
+ <a href="<%= u("job history/linear_history") %>?<%=
21
+ { "page_size" => page_size,
22
+ "page_num" => [1, page_num - 1].max }.to_param %>"
21
23
  class="job_history_prev_page"
22
24
  disabled="<%= page_num > 1 %>">
23
25
  &lt; Prev
@@ -27,8 +29,9 @@
27
29
  <div class="job_history_pages">
28
30
  <% (first_page..last_page).each do |page_number| %>
29
31
  <% if page_number != page_num %>
30
- <a href="linear_history?<%= { "page_size" => page_size,
31
- "page_num" => page_number }.to_param %>"
32
+ <a href="<%= u("job history/linear_history") %>?<%=
33
+ { "page_size" => page_size,
34
+ "page_num" => page_number }.to_param %>"
32
35
  class="job_history_page">
33
36
  <%= page_number %>
34
37
  </a>
@@ -39,15 +42,17 @@
39
42
  </div>
40
43
 
41
44
  <div class="job_history_next_links">
42
- <a href="linear_history?<%= { "page_size" => page_size,
43
- "page_num" => [total_pages, page_num + 1].min }.to_param %>"
45
+ <a href="<%= u("job history/linear_history") %>?<%=
46
+ { "page_size" => page_size,
47
+ "page_num" => [total_pages, page_num + 1].min }.to_param %>"
44
48
  class="job_history_next_page"
45
49
  disabled="<%= page_num < last_page %>">
46
50
  Next &gt;
47
51
  </a>
48
52
 
49
- <a href="linear_history?<%= { "page_size" => page_size,
50
- "page_num" => total_pages }.to_param %>"
53
+ <a href="<%= u("job history/linear_history") %>?<%=
54
+ { "page_size" => page_size,
55
+ "page_num" => total_pages }.to_param %>"
51
56
  class="job_history_last_page"
52
57
  disabled="<%= last_page < total_pages %>">
53
58
  Last &gt;&gt;
@@ -1,4 +1,4 @@
1
- <link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
1
+ <link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
2
2
 
3
3
  <h1><%= @job_class_name %></h1>
4
4
 
@@ -38,6 +38,14 @@
38
38
  <%= class_info.total_finished_jobs.to_i %>
39
39
  </td>
40
40
  </tr>
41
+ <tr>
42
+ <td>
43
+ Total jobs failed
44
+ </td>
45
+ <td>
46
+ <%= class_info.total_failed_jobs.to_i %>
47
+ </td>
48
+ </tr>
41
49
  <tr>
42
50
  <td>
43
51
  Total jobs in history
@@ -101,7 +109,7 @@
101
109
  This class cannot be purged because of another class with a similar name. The other class must
102
110
  be purged before this one can be safely purged.
103
111
  <% else %>
104
- <form method="POST" action="purge_class?<%= { class_name: @job_class_name }.to_param %>">
112
+ <form method="POST" action="<%= u("job history/purge_class") %>?<%= { class_name: @job_class_name }.to_param %>">
105
113
  <input type="submit" name="" value="Purge all histories for <%= @job_class_name %>"/>
106
114
  </form>
107
115
  <% end %>
@@ -1,4 +1,4 @@
1
- <link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
1
+ <link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
2
2
 
3
3
  <h1>
4
4
  <%= @job_class_name %>
@@ -11,7 +11,7 @@
11
11
  Job History
12
12
  </a>
13
13
  |
14
- <a href="job_class_details?<%= { class_name: @job_class_name }.to_param %>">
14
+ <a href="<%= u("job history/job_class_details") %>?<%= { class_name: @job_class_name }.to_param %>">
15
15
  <%= @job_class_name %>
16
16
  </a>
17
17
  </p>
@@ -68,17 +68,20 @@
68
68
  <br/>
69
69
 
70
70
  <% unless job_details.finished? %>
71
- <form method="POST" action="cancel_job?<%= { class_name: @job_class_name, job_id: @job_id }.to_param %>">
71
+ <form method="POST" action="<%= u("job history/cancel_job") %>?<%=
72
+ { class_name: @job_class_name, job_id: @job_id }.to_param %>">
72
73
  <input type="submit" name="" value="Job is not running - Cancel job"/>
73
74
  </form>
74
75
  <% end %>
75
76
 
76
- <form method="POST" action="delete_job?<%= { class_name: @job_class_name, job_id: @job_id }.to_param %>">
77
+ <form method="POST" action="<%= u("job history/delete_job") %>?<%=
78
+ { class_name: @job_class_name, job_id: @job_id }.to_param %>">
77
79
  <input type="submit" name="" value="Delete this run"/>
78
80
  </form>
79
81
 
80
82
  <% if Resque::Plugins::JobHistory::HistoryDetails.new(@job_class_name).class_name_valid?() %>
81
- <form method="POST" action="retry_job?<%= { class_name: @job_class_name, job_id: @job_id }.to_param %>">
83
+ <form method="POST" action="<%= u("job history/retry_job") %>?<%=
84
+ { class_name: @job_class_name, job_id: @job_id }.to_param %>">
82
85
  <input type="submit" name="" value="Retry this run"/>
83
86
  </form>
84
87
  <% end %>
@@ -1,4 +1,4 @@
1
- <link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
1
+ <link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
2
2
 
3
3
  <h1>Job Classes</h1>
4
4
 
@@ -16,60 +16,68 @@
16
16
  <div class="table_container">
17
17
  <table>
18
18
  <tr>
19
- <th><a href="job%20history?<%= { sort: "class_name",
20
- page_size: @page_size,
21
- page_num: @page_num,
22
- order: job_list.
23
- order_param("class_name", @sort_by, @sort_order) }.to_param %>">
19
+ <th><a href="<%= u("job history") %>?<%=
20
+ { sort: "class_name",
21
+ page_size: @page_size,
22
+ page_num: @page_num,
23
+ order: job_list.
24
+ order_param("class_name", @sort_by, @sort_order) }.to_param %>">
24
25
  Class name
25
26
  </a></th>
26
- <th><a href="job%20history?<%= { sort: "num_running_jobs",
27
- page_size: @page_size,
28
- page_num: @page_num,
29
- order: job_list.
30
- order_param("num_running_jobs", @sort_by, @sort_order) }.to_param %>">
27
+ <th><a href="<%= u("job history") %>?<%=
28
+ { sort: "num_running_jobs",
29
+ page_size: @page_size,
30
+ page_num: @page_num,
31
+ order: job_list.
32
+ order_param("num_running_jobs", @sort_by, @sort_order) }.to_param %>">
31
33
  Running
32
34
  </a></th>
33
- <th><a href="job%20history?<%= { sort: "total_run_jobs",
34
- page_size: @page_size,
35
- page_num: @page_num,
36
- order: job_list.
37
- order_param("total_run_jobs", @sort_by, @sort_order) }.to_param %>">
35
+ <th><a href="<%= u("job history") %>?<%=
36
+ { sort: "total_run_jobs",
37
+ page_size: @page_size,
38
+ page_num: @page_num,
39
+ order: job_list.
40
+ order_param("total_run_jobs", @sort_by, @sort_order) }.to_param %>">
38
41
  Total Run
39
42
  </a></th>
40
- <th><a href="job%20history?<%= { sort: "total_finished_jobs",
41
- page_size: @page_size,
42
- page_num: @page_num,
43
- order: job_list.
44
- order_param("total_finished_jobs", @sort_by, @sort_order) }.to_param %>">
43
+ <th><a href="<%= u("job history") %>?<%=
44
+ { sort: "total_finished_jobs",
45
+ page_size: @page_size,
46
+ page_num: @page_num,
47
+ order: job_list.
48
+ order_param("total_finished_jobs", @sort_by, @sort_order) }.to_param %>">
45
49
  Finished
46
50
  </a></th>
47
- <th><a href="job%20history?<%= { sort: "max_concurrent_jobs",
48
- page_size: @page_size,
49
- page_num: @page_num,
50
- order: job_list.
51
- order_param("max_concurrent_jobs", @sort_by, @sort_order) }.to_param %>">
52
- Max Running
51
+ <th><a href="<%= u("job history") %>?<%=
52
+ { sort: "total_failed_jobs",
53
+ page_size: @page_size,
54
+ page_num: @page_num,
55
+ order: job_list.
56
+ order_param("total_failed_jobs", @sort_by, @sort_order) }.to_param %>">
57
+ Failed
53
58
  </a></th>
54
- <th><a href="job%20history?<%= { sort: "start_time",
55
- page_size: @page_size,
56
- page_num: @page_num,
57
- order: job_list.
58
- order_param("start_time", @sort_by, @sort_order) }.to_param %>">
59
+ <th><a href="<%= u("job history") %>?<%=
60
+ { sort: "start_time",
61
+ page_size: @page_size,
62
+ page_num: @page_num,
63
+ order: job_list.
64
+ order_param("start_time", @sort_by, @sort_order) }.to_param %>">
59
65
  Last Run Start
60
66
  </a></th>
61
- <th><a href="job%20history?<%= { sort: "duration",
62
- page_size: @page_size,
63
- page_num: @page_num,
64
- order: job_list.
65
- order_param("duration", @sort_by, @sort_order) }.to_param %>">
67
+ <th><a href="<%= u("job history") %>?<%=
68
+ { sort: "duration",
69
+ page_size: @page_size,
70
+ page_num: @page_num,
71
+ order: job_list.
72
+ order_param("duration", @sort_by, @sort_order) }.to_param %>">
66
73
  Last Run Duration
67
74
  </a></th>
68
- <th><a href="job%20history?<%= { sort: "success",
69
- page_size: @page_size,
70
- page_num: @page_num,
71
- order: job_list.
72
- order_param("success", @sort_by, @sort_order) }.to_param %>">
75
+ <th><a href="<%= u("job history") %>?<%=
76
+ { sort: "success",
77
+ page_size: @page_size,
78
+ page_num: @page_num,
79
+ order: job_list.
80
+ order_param("success", @sort_by, @sort_order) }.to_param %>">
73
81
  Last Run successful
74
82
  </a></th>
75
83
  </tr>
@@ -77,7 +85,7 @@
77
85
  <% job_list.job_summaries(@sort_by, @sort_order, @page_num, @page_size).each do |class_info| %>
78
86
  <tr<%= class_info.last_run && !class_info.last_run.succeeded? ? " class=\"job_history_error\"" : "" %>>
79
87
  <td>
80
- <a href="job%20history/job_class_details?class_name=<%= class_info.class_name %>">
88
+ <a href="<%= u("job history") %>/job_class_details?class_name=<%= class_info.class_name %>">
81
89
  <%= class_info.class_name %>
82
90
  </a>
83
91
  </td>
@@ -91,7 +99,7 @@
91
99
  <%= class_info.total_finished_jobs.to_i %>
92
100
  </td>
93
101
  <td>
94
- <%= class_info.max_concurrent_jobs.to_i %>
102
+ <%= class_info.total_failed_jobs.to_i %>
95
103
  </td>
96
104
  <td>
97
105
  <% if class_info.last_run && class_info.last_run.start_time %>
@@ -127,7 +135,7 @@
127
135
  <br/>
128
136
 
129
137
  <div>
130
- <form method="POST" action="job%20history/purge_all">
138
+ <form method="POST" action="<%= u("job history/purge_all") %>">
131
139
  <input type="submit" name="" value="Purge all histories"/>
132
140
  </form>
133
141
  </div>
@@ -1,4 +1,4 @@
1
- <link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
1
+ <link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
2
2
 
3
3
  <h1>Linear History</h1>
4
4
 
@@ -29,7 +29,8 @@
29
29
  <% jobs.each do |job_details| %>
30
30
  <tr<%= job_details.succeeded? ? "" : " class=\"job_history_error\"" %>>
31
31
  <td>
32
- <a href="job_details?class_name=<%= job_details.class_name %>&job_id=<%= job_details.job_id %>">
32
+ <a href="<%= u("job history/job_details") %>?<%=
33
+ { class_name: job_details.class_name, job_id: job_details.job_id }.to_param %>">
33
34
  <%= job_details.class_name %>
34
35
  </a>
35
36
  </td>
@@ -42,7 +43,7 @@
42
43
  <% end %>
43
44
  </td>
44
45
  <td>
45
- <%# = distance_of_time_in_words(job_details.start_time, (job_details.end_time || Time.now)) %>
46
+ <%= distance_of_time_in_words(job_details.start_time, (job_details.end_time || Time.now)) %>
46
47
  <% if job_details.finished? %>
47
48
  (<%= job_details.end_time %>)
48
49
  <% end %>
@@ -63,3 +64,11 @@
63
64
  page_num: @page_num,
64
65
  page_size: @page_size }) %>
65
66
  <% end %>
67
+
68
+ <br/>
69
+
70
+ <div>
71
+ <form method="POST" action="<%= u("job history/purge_linear_history") %>">
72
+ <input type="submit" name="" value="Purge linear histories"/>
73
+ </form>
74
+ </div>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-job_history
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - RealNobody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-13 00:00:00.000000000 Z
11
+ date: 2016-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rack-test
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  description: Keeps a history of run jobs by job.
168
182
  email:
169
183
  - RealNobody1@cox.net