resque-cleaner 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/resque_cleaner/server.rb +14 -7
- data/test/resque_web_test.rb +2 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -3,12 +3,6 @@
|
|
3
3
|
module ResqueCleaner
|
4
4
|
module Server
|
5
5
|
|
6
|
-
begin
|
7
|
-
require 'yajl/json_gem'
|
8
|
-
rescue Exception
|
9
|
-
require 'json'
|
10
|
-
end
|
11
|
-
|
12
6
|
def self.erb_path(filename)
|
13
7
|
File.join(File.dirname(__FILE__), 'server', 'views', filename)
|
14
8
|
end
|
@@ -67,7 +61,7 @@ module ResqueCleaner
|
|
67
61
|
end
|
68
62
|
|
69
63
|
def self.included(base)
|
70
|
-
|
64
|
+
|
71
65
|
base.class_eval do
|
72
66
|
helpers do
|
73
67
|
def time_filter(id, name, value)
|
@@ -96,6 +90,7 @@ module ResqueCleaner
|
|
96
90
|
end
|
97
91
|
|
98
92
|
get "/cleaner" do
|
93
|
+
load_library
|
99
94
|
load_cleaner_filter
|
100
95
|
|
101
96
|
@jobs = cleaner.select
|
@@ -119,6 +114,7 @@ module ResqueCleaner
|
|
119
114
|
end
|
120
115
|
|
121
116
|
get "/cleaner_list" do
|
117
|
+
load_library
|
122
118
|
load_cleaner_filter
|
123
119
|
|
124
120
|
block = filter_block
|
@@ -135,6 +131,7 @@ module ResqueCleaner
|
|
135
131
|
end
|
136
132
|
|
137
133
|
post "/cleaner_exec" do
|
134
|
+
load_library
|
138
135
|
load_cleaner_filter
|
139
136
|
|
140
137
|
if params[:select_all_pages]!="1"
|
@@ -156,6 +153,7 @@ module ResqueCleaner
|
|
156
153
|
end
|
157
154
|
|
158
155
|
post "/cleaner_stale" do
|
156
|
+
load_library
|
159
157
|
cleaner.clear_stale
|
160
158
|
redirect "/cleaner"
|
161
159
|
end
|
@@ -173,6 +171,15 @@ module ResqueCleaner
|
|
173
171
|
@cleaner
|
174
172
|
end
|
175
173
|
|
174
|
+
def load_library
|
175
|
+
require 'digest/sha1'
|
176
|
+
begin
|
177
|
+
require 'yajl/json_gem' unless [].respond_to?(:to_json)
|
178
|
+
rescue Exception
|
179
|
+
require 'json'
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
176
183
|
def load_cleaner_filter
|
177
184
|
@from = params[:f]=="" ? nil : params[:f]
|
178
185
|
@to = params[:t]=="" ? nil : params[:t]
|
data/test/resque_web_test.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tatsuya Ono
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-07 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|