sidekiq-uniq 0.4.0 → 0.5.0

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: 8a78685eb5525e8ee52f46d3f9fbea6b4dfc20da
4
- data.tar.gz: 077917c7992bab115d7eff991c5b55e8fef947aa
3
+ metadata.gz: 3b2b32221e78a36897f8403fb309ef2b82e43f9a
4
+ data.tar.gz: 9e6ea3a7759fd3a5211efb04ce2135a11d949db8
5
5
  SHA512:
6
- metadata.gz: f19f7a049b3d07f0a64ce4441c4d0204a83bb72bdd7b86af570b2b910d10efa93253e4017d858aa54fa7a1dc602b7877dc029cd44b34adca3c194002074329e5
7
- data.tar.gz: ab1e273a39570c52d2adacff568d259571f6966730bb2eaa1b50e4e8a8319cb2db793c85fe41f41140599325db1a38dfb6bb23419119dcafe169bfe217120757
6
+ metadata.gz: 12b732895efd8b1f4d0712efab9fa808eede82f7fc5d2b7d0d36a5c7623c4f7c57a91c0b76b98ec455be492d0bd8ce6f5fd57f694fea30c73a93adb90937bcc2
7
+ data.tar.gz: 26afda27a80958c1e2bc3168b4ba3c3471adeff2a6a12f932ec3d17c5eba42441bfc02ea91988b1992e61b74cf65d5f0b65f5d288a70ac4a2d3027e3425edaf8
@@ -8,13 +8,11 @@ module Sidekiq
8
8
  # Runs before job is added to queue
9
9
 
10
10
  def call(worker_class, msg, queue_name, redis_pool)
11
- if msg['unique'] === false
12
- yield
13
- else
11
+ unless msg['unique'] === false
14
12
  return false if Status.running_or_enqueued(msg, redis_pool)
15
13
  Status.save_status(msg, :enqueued, redis_pool)
16
- yield
17
14
  end
15
+ yield
18
16
  end
19
17
  end
20
18
 
@@ -4,19 +4,17 @@ module Sidekiq
4
4
  module Uniq
5
5
  class Railtie < ::Rails::Railtie
6
6
  initializer 'sidekiq_uniq_middleware' do
7
-
8
7
  Sidekiq.configure_server do |config|
9
- config.client_middleware do |chain|
10
- chain.add Sidekiq::Uniq::ServerMiddleware
11
- end
12
- end
13
8
 
14
- Sidekiq.configure_client do |config|
15
9
  config.client_middleware do |chain|
16
10
  chain.add Sidekiq::Uniq::ClientMiddleware
17
11
  end
18
- end
19
12
 
13
+ config.server_middleware do |chain|
14
+ chain.add Sidekiq::Uniq::ServerMiddleware
15
+ end
16
+
17
+ end
20
18
  end
21
19
  end
22
20
  end
@@ -12,7 +12,7 @@ module Sidekiq
12
12
  end
13
13
 
14
14
  def self.key(msg)
15
- KEY + ':' + Digest::MD5.hexdigest(msg[:class].to_s + ':' + msg[:args].inspect)
15
+ KEY + ':' + Digest::MD5.hexdigest(msg['class'].to_s + ':' + msg['args'].inspect)
16
16
  end
17
17
 
18
18
  def self.save_status(msg, status, redis = nil)
@@ -30,7 +30,7 @@ module Sidekiq
30
30
  Status.redis(redis) do |conn|
31
31
  status = conn.get(Status.key(msg)).to_s
32
32
  end
33
- status === 'running' || status === 'enqueued'
33
+ (status === 'running' || status === 'enqueued')
34
34
  end
35
35
 
36
36
  def self.clear(redis = nil)
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Uniq
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-uniq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caio SBA
@@ -73,8 +73,7 @@ files:
73
73
  - lib/sidekiq/uniq/railtie.rb
74
74
  - lib/sidekiq/uniq/status.rb
75
75
  - lib/sidekiq/uniq/version.rb
76
- - sidekiq-uniq-0.1.0.gem
77
- - sidekiq-uniq-0.2.0.gem
76
+ - sidekiq-uniq-0.4.0.gem
78
77
  - sidekiq-uniq.gemspec
79
78
  homepage: https://github.com/caiosba/sidekiq-uniq
80
79
  licenses:
Binary file
Binary file