resque-unique_by_arity 1.0.3 → 1.0.5

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
2
  SHA1:
3
- metadata.gz: 74a015294d4c2dfa38a26395f3c83747c49cc380
4
- data.tar.gz: 3a2aa2f9318deaab45185805561efde660c2dda0
3
+ metadata.gz: 00cde0223f9209ac2c49d83ffd8994c24f545dec
4
+ data.tar.gz: 6265a29d80091ab4cf13efbb3960d16319629c1a
5
5
  SHA512:
6
- metadata.gz: f811ec7c91598ddd783b69c1eeedb6ca7f5bf0b2b75b04c5d637bd6cd143c4f3f292cb16f82cca03d2b72227c201a9690bbbe5f0dcd2ef45bd69e129859741e2
7
- data.tar.gz: 7be024ae58c1a2a70c12add6f5b24d471bc7b85c6ac26db7c20b9d7236a7e3ee3d54a645d953ca350ca37a077a88460e2aca7655be8ad0f0f3cb8451d1774f40
6
+ metadata.gz: 877c2c64b4b05ca0acdd4722559421257078a507e123496e147b103844fedfe5c6cf7796b14b292463683c0b96916fe2ecf66658cd3c1ddccbdacc33ba1b9161
7
+ data.tar.gz: 7ff7957a8f8b43a944ea7b64c8e28eff5b04226a5236662dbe5855a9d9ed269f5ec9750e71a78a6639c897024952153102dec6049f34490f36cd334422fae5d1
@@ -91,5 +91,6 @@ module Resque
91
91
  @uniqueness_configuration.unique_across_queues = unique_across_queues
92
92
  end
93
93
  self.uniqueness_configuration = Configuration.new # setup defaults
94
+ module_function(:unique_log)
94
95
  end
95
96
  end
@@ -23,12 +23,16 @@ module Resque
23
23
  @unique_across_queues = options.key?(:unique_across_queues) ? options[:unique_across_queues] : false
24
24
  # The default config initialization shouldn't trigger any warnings.
25
25
  if options.keys.length > 0 && @logger
26
- Resque::UniqueByArity.unique_log ":arity_for_uniqueness is set to #{@arity_for_uniqueness}, but no uniqueness enforcement was turned on [:unique_at_runtime, :unique_in_queue, :unique_across_queues]" unless @unique_at_runtime || @unique_in_queue || @unique_across_queues
27
- Resque::UniqueByArity.unique_log ":lock_after_execution_period is set to #{@lock_after_execution_period}, but :unique_at_runtime is not set" if @lock_after_execution_period && !@unique_at_runtime
28
- Resque::UniqueByArity.unique_log ":unique_in_queue and :unique_across_queues should not be set at the same time, as :unique_across_queues will always supercede :unique_in_queue" if @unique_in_queue && @unique_across_queues
26
+ log ":arity_for_uniqueness is set to #{@arity_for_uniqueness}, but no uniqueness enforcement was turned on [:unique_at_runtime, :unique_in_queue, :unique_across_queues]" unless @unique_at_runtime || @unique_in_queue || @unique_across_queues
27
+ log ":lock_after_execution_period is set to #{@lock_after_execution_period}, but :unique_at_runtime is not set" if @lock_after_execution_period && !@unique_at_runtime
28
+ log ":unique_in_queue and :unique_across_queues should not be set at the same time, as :unique_across_queues will always supercede :unique_in_queue" if @unique_in_queue && @unique_across_queues
29
29
  end
30
30
  end
31
31
 
32
+ def log(msg)
33
+ Resque::UniqueByArity.unique_log(msg, self)
34
+ end
35
+
32
36
  def to_hash
33
37
  {
34
38
  logger: logger,
@@ -58,7 +62,7 @@ module Resque
58
62
  end
59
63
  case arity_validation
60
64
  when :warning then
61
- Resque::UniqueByArity.unique_log(msg)
65
+ log(msg)
62
66
  when :error then
63
67
  raise ArgumentError, msg
64
68
  else
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module UniqueByArity
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-unique_by_arity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling