resque-cleaner 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/lib/resque_cleaner.rb +13 -9
- data/test/dump.rdb +1 -0
- data/test/redis-test.conf +1 -1
- metadata +3 -2
data/CHANGELOG.md
CHANGED
data/lib/resque_cleaner.rb
CHANGED
@@ -118,17 +118,21 @@ module Resque
|
|
118
118
|
if !block_given? || block.call(job)
|
119
119
|
index = @limiter.start_index + i - requeued
|
120
120
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
121
|
+
value = redis.lindex(:failed, index)
|
122
|
+
redis.multi do
|
123
|
+
Job.create(queue||job['queue'], job['payload']['class'], *job['payload']['args'])
|
124
|
+
|
125
|
+
if clear_after_requeue
|
126
|
+
# remove job
|
127
|
+
# TODO: should use ltrim. not sure why i used lrem here...
|
128
|
+
redis.lrem(:failed, 1, value)
|
129
|
+
else
|
130
|
+
# mark retried
|
131
|
+
job['retried_at'] = Time.now.strftime("%Y/%m/%d %H:%M:%S")
|
132
|
+
redis.lset(:failed, @limiter.start_index+i, Resque.encode(job))
|
133
|
+
end
|
129
134
|
end
|
130
135
|
|
131
|
-
Job.create(queue||job['queue'], job['payload']['class'], *job['payload']['args'])
|
132
136
|
requeued += 1
|
133
137
|
end
|
134
138
|
end
|
data/test/dump.rdb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
REDIS0002�
|
data/test/redis-test.conf
CHANGED
@@ -112,4 +112,4 @@ databases 16
|
|
112
112
|
# Glue small output buffers together in order to send small replies in a
|
113
113
|
# single TCP packet. Uses a bit more CPU but most of the times it is a win
|
114
114
|
# in terms of number of queries per second. Use 'yes' if unsure.
|
115
|
-
glueoutputbuf yes
|
115
|
+
#glueoutputbuf yes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: resque
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- lib/resque_cleaner/server/views/cleaner_list.erb
|
52
52
|
- lib/resque_cleaner/server.rb
|
53
53
|
- lib/resque_cleaner.rb
|
54
|
+
- test/dump.rdb
|
54
55
|
- test/redis-test.conf
|
55
56
|
- test/resque_cleaner_test.rb
|
56
57
|
- test/resque_web_test.rb
|