resque-population-control 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque/plugins/population_control.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5b17d252694711dbed81ce90d2593ac7ce5f9e9
|
4
|
+
data.tar.gz: 42d8099c6c380e43074bbf42d593c1f9294fbf5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d17e54b008b1c63e389f43d6c08fa8822deeaf17c606cd8e0b904c87435d1c09ca979a34a6aca204881def3bd69eac1f2c544ba21c156a741784a03ddafa00
|
7
|
+
data.tar.gz: 221be694ff83dee2dc75baae320c4604fb230a4cf8f051860d8141b332fd941c76024f899963d980cd25c4ce83c1373e4441896b1cb8df3b3e5892874e4d8424
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Resque
|
2
2
|
module Plugins
|
3
3
|
module PopulationControl
|
4
|
-
VERSION = "0.
|
4
|
+
VERSION = "0.6.0"
|
5
5
|
|
6
6
|
class PopulationExceeded < ::StandardError; end;
|
7
7
|
|
@@ -14,6 +14,10 @@ module Resque
|
|
14
14
|
population_control_count <= population_control_max
|
15
15
|
end
|
16
16
|
|
17
|
+
def population_control_clear
|
18
|
+
population_control_redis.del population_control_cache_key
|
19
|
+
end
|
20
|
+
|
17
21
|
def max_population?
|
18
22
|
population_control_count >= population_control_max
|
19
23
|
end
|
@@ -36,6 +40,10 @@ module Resque
|
|
36
40
|
population_control_decrement
|
37
41
|
end
|
38
42
|
|
43
|
+
def on_failure e, *args
|
44
|
+
population_control_decrement
|
45
|
+
end
|
46
|
+
|
39
47
|
def population_control_max
|
40
48
|
@population_control_max
|
41
49
|
end
|