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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b4301532dbe01fd400f2fdd276beab3a790ab5f4
4
- data.tar.gz: 885590015fe0fda02175694da4b1e6e3fdfc75cd
2
+ SHA256:
3
+ metadata.gz: 3d6d234893805d5dc55d0f0401cb4a953c7650f281823d172ef9406d5e24839b
4
+ data.tar.gz: 6c49a1093ebdc6ecbe04143e6b05224b67934eb4ba0cb1c0a0458af621e8c704
5
5
  SHA512:
6
- metadata.gz: fad42f3ef35691176c320fe33a5c55023664b0c29dbac8484982f86fd2c9e784097bc4be5d8e98ff74c309aa576182c295c27294ceac64bbc7dbf0d266ddda75
7
- data.tar.gz: 8d1d05c15bd9f3ac0f9b277737862913b45483d837bd417dc8e99b75dbbf6deea56fbdf8231ee38ea1b829fe4553bed8192fd9ec92c9911410b59e6f568ef39e
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%20history" do
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%20history/job_class_details" do
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%20history/job_details" do
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%20history/linear_history" do
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%20history/cancel_job" do
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%20history/delete_job" do
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%20history/retry_job" do
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%20history/purge_class" do
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%20history/purge_all" do
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%20history/purge_linear_history" do
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%20history/search_all" do
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%20history/search_job" do
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%20history/search_linear_history" do
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 mapp:
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.
@@ -48,6 +48,8 @@ module Resque
48
48
  purge_class class_name
49
49
  end
50
50
 
51
+ purge_linear_history
52
+
51
53
  del_key(Resque::Plugins::JobHistory::HistoryDetails.job_history_key, "Purging job_history_key")
52
54
 
53
55
  redis.keys("*").each do |key|
@@ -86,11 +86,13 @@ module Resque
86
86
  end
87
87
 
88
88
  def delete_old_jobs(job_count)
89
- while job_count > max_jobs
90
- job_id = redis.rpop(job_list_key)
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(job_class(job_id), job_id).safe_purge
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
- ("#{exception.message}\n\n#{exception.process_status&.message}\n\n" +
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.13
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: 2017-08-31 00:00:00.000000000 Z
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: '1.25'
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: '1.25'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: redis-namespace
28
+ name: sinatra
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
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: '0'
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: actionpack
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: :development
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: activejob
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: activesupport
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: sinatra
98
+ name: activesupport
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '1.4'
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: '1.4'
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: '0'
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: '0'
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
- rubyforge_project:
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.
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Resque
4
- module Plugins
5
- module JobHistory
6
- VERSION = "0.0.13"
7
- end
8
- end
9
- end