resque-job_history 0.0.14 → 0.0.19
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 +8 -0
- data/lib/resque/server/views/_job_list_table.erb +1 -1
- data/lib/resque/server/views/_job_summary_rows.erb +1 -1
- data/lib/resque/server/views/job_details.erb +1 -1
- metadata +36 -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: 80f12f012c42ce5ef6d0752d9577bab10c136e23092b993fa8ed7956a6fe14f9
|
4
|
+
data.tar.gz: 6402151b24dd3ed4977c5dc84b6961183b0325565c6311160d47d614d6ac77bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a8a66dd34b106ff998329a8d9d97c49049e9bae75b0fe3f7e378d6758d9f62645e0b0613933868fc97f591dfbdd607c7865f9ab94cc013d7f76f9a64de07f0e
|
7
|
+
data.tar.gz: b8c3c45e954382aa89d9e8533da10647df5d5e47e9d09cf50cc9bc42b2390d30feb72a8dd385a454e4a319906bed65f6353ce8316f97a5a80bb02d0f4fc59d87
|
@@ -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
|
@@ -44,6 +44,14 @@ module Resque
|
|
44
44
|
decode_args(stored_values[:args])
|
45
45
|
end
|
46
46
|
|
47
|
+
def uncompressed_args
|
48
|
+
return args if described_class.blank?
|
49
|
+
return args unless described_class.singleton_class.included_modules.map(&:name).include?("Resque::Plugins::Compressible")
|
50
|
+
return args unless described_class.compressed?(args)
|
51
|
+
|
52
|
+
described_class.uncompressed_args(args.first[:payload] || args.first["payload"])
|
53
|
+
end
|
54
|
+
|
47
55
|
def error
|
48
56
|
stored_values[:error]
|
49
57
|
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,29 +1,43 @@
|
|
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.19
|
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-07-11 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
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sinatra
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
33
|
+
version: 2.0.7
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- - "
|
38
|
+
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
40
|
+
version: 2.0.7
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: redis-namespace
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,21 +109,21 @@ dependencies:
|
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: cornucopia
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- - "
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
117
|
+
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- - "
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: faker
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - ">="
|
@@ -137,7 +151,7 @@ dependencies:
|
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
154
|
+
name: haml-lint
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - ">="
|
@@ -151,7 +165,7 @@ dependencies:
|
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
168
|
+
name: rack-test
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - ">="
|
@@ -165,7 +179,7 @@ dependencies:
|
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
182
|
+
name: resque-compressible
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - ">="
|
@@ -179,21 +193,21 @@ dependencies:
|
|
179
193
|
- !ruby/object:Gem::Version
|
180
194
|
version: '0'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
196
|
+
name: rspec-rails
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
184
198
|
requirements:
|
185
199
|
- - ">="
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
201
|
+
version: 3.6.0
|
188
202
|
type: :development
|
189
203
|
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
206
|
- - ">="
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
208
|
+
version: 3.6.0
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
210
|
+
name: rubocop
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
213
|
- - ">="
|
@@ -207,7 +221,7 @@ dependencies:
|
|
207
221
|
- !ruby/object:Gem::Version
|
208
222
|
version: '0'
|
209
223
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
224
|
+
name: simplecov
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
212
226
|
requirements:
|
213
227
|
- - ">="
|
@@ -221,7 +235,7 @@ dependencies:
|
|
221
235
|
- !ruby/object:Gem::Version
|
222
236
|
version: '0'
|
223
237
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
238
|
+
name: timecop
|
225
239
|
requirement: !ruby/object:Gem::Requirement
|
226
240
|
requirements:
|
227
241
|
- - ">="
|
@@ -252,7 +266,6 @@ files:
|
|
252
266
|
- lib/resque/plugins/job_history/job.rb
|
253
267
|
- lib/resque/plugins/job_history/job_list.rb
|
254
268
|
- lib/resque/plugins/job_history/job_search.rb
|
255
|
-
- lib/resque/plugins/version.rb
|
256
269
|
- lib/resque/server/public/job_history.css
|
257
270
|
- lib/resque/server/views/_job_class_pagination.erb
|
258
271
|
- lib/resque/server/views/_job_list_table.erb
|
@@ -286,8 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
299
|
- !ruby/object:Gem::Version
|
287
300
|
version: '0'
|
288
301
|
requirements: []
|
289
|
-
|
290
|
-
rubygems_version: 2.5.1
|
302
|
+
rubygems_version: 3.0.3
|
291
303
|
signing_key:
|
292
304
|
specification_version: 4
|
293
305
|
summary: Keeps a history of run jobs by job.
|