resque-population-control 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea47539d34c221eefa4ef20c569bc0720eaa4ce1
4
- data.tar.gz: b5fb7db383b5a98cc72c3c0c8820aa2178d56668
3
+ metadata.gz: a5b17d252694711dbed81ce90d2593ac7ce5f9e9
4
+ data.tar.gz: 42d8099c6c380e43074bbf42d593c1f9294fbf5f
5
5
  SHA512:
6
- metadata.gz: 107c994c9fead4b480605583aa8d9ae61a641e0164e30b0920cff849ded7ec3b96e08b18a4a2ec4230d4648be580739a6bcbd73eae13441e387d1cfbb58ea7c0
7
- data.tar.gz: 7edd7ae9f35c7280ef2a2fe23dab1306fcd980b2de992aa9da57627eb473ff1e275a52af7621f391e26f87e8b1b34c06ebb965ccdbbbcb570daddd7847906a83
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.5.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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-population-control
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Misha Conway