resque-job_history 0.0.13 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/resque/job_history_server.rb +14 -14
- data/lib/resque/plugins/job_history.rb +1 -1
- data/lib/resque/plugins/job_history/cleaner.rb +2 -0
- data/lib/resque/plugins/job_history/history_list.rb +5 -3
- data/lib/resque/plugins/job_history/job.rb +1 -2
- data/lib/resque/server/views/_job_summary_rows.erb +1 -1
- metadata +22 -24
- data/lib/resque/plugins/version.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3d6d234893805d5dc55d0f0401cb4a953c7650f281823d172ef9406d5e24839b
|
4
|
+
data.tar.gz: 6c49a1093ebdc6ecbe04143e6b05224b67934eb4ba0cb1c0a0458af621e8c704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b2dd615e2f827800550bd709b4d5dcecbf6cc8df3a3fab854cb76e43da02de701419d854ba91697eee0d5b0ee5c009a903ac55610f06d077df89fbdfebc0e32
|
7
|
+
data.tar.gz: dca26cba1bfee9f7454bed17984f03e2799bfc6f01ad699e13704b44672cd8b9ebd7444f9f564d6058823037d40f74d89c691deadd1f3487dc6a71b2c4f94744
|
@@ -41,7 +41,7 @@ module Resque
|
|
41
41
|
job_history_params(base)
|
42
42
|
|
43
43
|
base.class_eval do
|
44
|
-
get "/job
|
44
|
+
get "/job history" do
|
45
45
|
set_job_history_params
|
46
46
|
|
47
47
|
erb File.read(Resque::JobHistoryServer.erb_path("job_history.erb"))
|
@@ -67,7 +67,7 @@ module Resque
|
|
67
67
|
finished_page_params(base)
|
68
68
|
|
69
69
|
base.class_eval do
|
70
|
-
get "/job
|
70
|
+
get "/job history/job_class_details" do
|
71
71
|
set_class_details_params
|
72
72
|
|
73
73
|
erb File.read(Resque::JobHistoryServer.erb_path("job_class_details.erb"))
|
@@ -107,7 +107,7 @@ module Resque
|
|
107
107
|
|
108
108
|
def job_details(base)
|
109
109
|
base.class_eval do
|
110
|
-
get "/job
|
110
|
+
get "/job history/job_details" do
|
111
111
|
@job_class_name = params[:class_name]
|
112
112
|
@job_id = params[:job_id]
|
113
113
|
|
@@ -118,7 +118,7 @@ module Resque
|
|
118
118
|
|
119
119
|
def linear_list(base)
|
120
120
|
base.class_eval do
|
121
|
-
get "/job
|
121
|
+
get "/job history/linear_history" do
|
122
122
|
@page_num = (params[:page_num] || 1).to_i
|
123
123
|
@page_size = (params[:page_size] ||
|
124
124
|
Resque::Plugins::JobHistory::HistoryDetails.linear_page_size).to_i
|
@@ -130,7 +130,7 @@ module Resque
|
|
130
130
|
|
131
131
|
def add_static_files(base)
|
132
132
|
base.class_eval do
|
133
|
-
get %r{job_history/public/([a-z_]+\.[a-z]+)} do
|
133
|
+
get %r{/job_history/public/([a-z_]+\.[a-z]+)} do
|
134
134
|
send_file Resque::JobHistoryServer.public_path(params[:captures].first)
|
135
135
|
end
|
136
136
|
end
|
@@ -150,7 +150,7 @@ module Resque
|
|
150
150
|
|
151
151
|
def cancel_job(base)
|
152
152
|
base.class_eval do
|
153
|
-
post "/job
|
153
|
+
post "/job history/cancel_job" do
|
154
154
|
Resque::Plugins::JobHistory::Job.new(params[:class_name], params[:job_id]).cancel
|
155
155
|
|
156
156
|
redirect u("job history/job_details?#{{ class_name: params[:class_name],
|
@@ -161,7 +161,7 @@ module Resque
|
|
161
161
|
|
162
162
|
def delete_job(base)
|
163
163
|
base.class_eval do
|
164
|
-
post "/job
|
164
|
+
post "/job history/delete_job" do
|
165
165
|
Resque::Plugins::JobHistory::Job.new(params[:class_name], params[:job_id]).purge
|
166
166
|
|
167
167
|
redirect u("job history/job_class_details?#{{ class_name: params[:class_name] }.to_param}")
|
@@ -171,7 +171,7 @@ module Resque
|
|
171
171
|
|
172
172
|
def retry_job(base)
|
173
173
|
base.class_eval do
|
174
|
-
post "/job
|
174
|
+
post "/job history/retry_job" do
|
175
175
|
Resque::Plugins::JobHistory::Job.new(params[:class_name], params[:job_id]).retry
|
176
176
|
|
177
177
|
redirect u("job history/job_class_details?#{{ class_name: params[:class_name] }.to_param}")
|
@@ -181,7 +181,7 @@ module Resque
|
|
181
181
|
|
182
182
|
def purge_class(base)
|
183
183
|
base.class_eval do
|
184
|
-
post "/job
|
184
|
+
post "/job history/purge_class" do
|
185
185
|
Resque::Plugins::JobHistory::Cleaner.purge_class(params[:class_name])
|
186
186
|
|
187
187
|
redirect u("job history")
|
@@ -191,7 +191,7 @@ module Resque
|
|
191
191
|
|
192
192
|
def purge_all(base)
|
193
193
|
base.class_eval do
|
194
|
-
post "/job
|
194
|
+
post "/job history/purge_all" do
|
195
195
|
Resque::Plugins::JobHistory::Cleaner.purge_all_jobs
|
196
196
|
|
197
197
|
redirect u("job history")
|
@@ -201,7 +201,7 @@ module Resque
|
|
201
201
|
|
202
202
|
def purge_linear_history(base)
|
203
203
|
base.class_eval do
|
204
|
-
post "/job
|
204
|
+
post "/job history/purge_linear_history" do
|
205
205
|
Resque::Plugins::JobHistory::Cleaner.purge_linear_history
|
206
206
|
|
207
207
|
redirect u("job history")
|
@@ -211,7 +211,7 @@ module Resque
|
|
211
211
|
|
212
212
|
def search_all(base)
|
213
213
|
base.class_eval do
|
214
|
-
post "/job
|
214
|
+
post "/job history/search_all" do
|
215
215
|
@job_search = Resque::Plugins::JobHistory::JobSearch.new(params)
|
216
216
|
|
217
217
|
@job_search.search
|
@@ -223,7 +223,7 @@ module Resque
|
|
223
223
|
|
224
224
|
def search_job(base)
|
225
225
|
base.class_eval do
|
226
|
-
post "/job
|
226
|
+
post "/job history/search_job" do
|
227
227
|
@job_search = Resque::Plugins::JobHistory::JobSearch.new(params)
|
228
228
|
|
229
229
|
@job_search.search
|
@@ -235,7 +235,7 @@ module Resque
|
|
235
235
|
|
236
236
|
def search_linear_history(base)
|
237
237
|
base.class_eval do
|
238
|
-
post "/job
|
238
|
+
post "/job history/search_linear_history" do
|
239
239
|
@job_search = Resque::Plugins::JobHistory::JobSearch.new(params)
|
240
240
|
|
241
241
|
@job_search.search
|
@@ -10,7 +10,7 @@ module Resque
|
|
10
10
|
module JobHistory
|
11
11
|
extend ActiveSupport::Concern
|
12
12
|
|
13
|
-
# Redis
|
13
|
+
# Redis map:
|
14
14
|
# job_history - a set of all of the class names of all jobs
|
15
15
|
# job_history..linear_jobs - a list of the IDs for all jobs that have run in the order
|
16
16
|
# they were started.
|
@@ -86,11 +86,13 @@ module Resque
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def delete_old_jobs(job_count)
|
89
|
-
while
|
90
|
-
job_id
|
89
|
+
while num_jobs > max_jobs
|
90
|
+
job_id = redis.rpop(job_list_key)
|
91
|
+
job_class_name = job_class(job_id)
|
92
|
+
|
91
93
|
remove_job_data(job_id)
|
92
94
|
|
93
|
-
Resque::Plugins::JobHistory::Job.new(
|
95
|
+
Resque::Plugins::JobHistory::Job.new(job_class_name, job_id).safe_purge
|
94
96
|
|
95
97
|
job_count -= 1
|
96
98
|
end
|
@@ -115,8 +115,7 @@ module Resque
|
|
115
115
|
|
116
116
|
def exception_message(exception)
|
117
117
|
if exception.is_a?(Resque::DirtyExit)
|
118
|
-
|
119
|
-
Array.wrap(exception.process_status&.backtrace).join("\n")).strip
|
118
|
+
"#{exception.message}\n\n#{exception.process_status.to_s}".strip
|
120
119
|
else
|
121
120
|
exception.message
|
122
121
|
end
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<td>
|
27
27
|
<% if class_info.last_run %>
|
28
28
|
<% if class_info.last_run.finished? %>
|
29
|
-
<%= distance_of_time_in_words(class_info.last_run.start_time, class_info.last_run.end_time) %>
|
29
|
+
<%= distance_of_time_in_words((class_info.last_run.start_time || Time.now), (class_info.last_run.end_time || Time.now)) %>
|
30
30
|
(<%= class_info.last_run.end_time %>)
|
31
31
|
<% else %>
|
32
32
|
Still running...
|
metadata
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-job_history
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RealNobody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: sinatra
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.0.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.0.7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: redis
|
42
|
+
name: redis-namespace
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,13 +53,13 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: redis
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
type: :
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: actionpack
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: activejob
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,33 +95,33 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: activesupport
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec-rails
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 3.6.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 3.6.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: gem-release
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,7 +252,6 @@ files:
|
|
252
252
|
- lib/resque/plugins/job_history/job.rb
|
253
253
|
- lib/resque/plugins/job_history/job_list.rb
|
254
254
|
- lib/resque/plugins/job_history/job_search.rb
|
255
|
-
- lib/resque/plugins/version.rb
|
256
255
|
- lib/resque/server/public/job_history.css
|
257
256
|
- lib/resque/server/views/_job_class_pagination.erb
|
258
257
|
- lib/resque/server/views/_job_list_table.erb
|
@@ -286,8 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
285
|
- !ruby/object:Gem::Version
|
287
286
|
version: '0'
|
288
287
|
requirements: []
|
289
|
-
|
290
|
-
rubygems_version: 2.5.1
|
288
|
+
rubygems_version: 3.0.3
|
291
289
|
signing_key:
|
292
290
|
specification_version: 4
|
293
291
|
summary: Keeps a history of run jobs by job.
|