unique_job 0.3.0.pre → 0.3.1.pre

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
  SHA256:
3
- metadata.gz: 9b63e8007f726ff6fa7024e33e896356a0f0a8165b811ef8df75fa890275e498
4
- data.tar.gz: 763c15b9b7b7f68c98977c9c12fb91ab000fa3b884de9992de6a37d34a28c390
3
+ metadata.gz: 10d542ca656951df33aad35ccc2bc6a7084e817440b5350589f29d318200be78
4
+ data.tar.gz: 1c029a320d84f7dc509a0315c1420e07fac331119ea643b58b391516c0f14804
5
5
  SHA512:
6
- metadata.gz: f1e5231116d67db01e395a3788b54d9a94cf94dd0ea691fe6feff2a5e7f7a79008b9b011badce76074dd03bd1c4857a633b6cc1975644a313b5d0c633f5ba6e7
7
- data.tar.gz: dcc61ef6f05b02d7bb8a285e429ff7499332341ba2ba10a7a6f6609e8505dbf065f227aa08eec3460b9c981f7cc5ae2c5977ba9aeecf9355ec21c85904d675af
6
+ metadata.gz: 99507fb879e9708a1488081d7cc5b6115c77f2b38915a3a23e162b2b862ea090d5ffd368ac5fb777629523218529acf5635bc9fa47156b9c5de6e1d4e746393f
7
+ data.tar.gz: 34d3309e4c134e5e8b03bf931473b84722d9393fc42d581acde96bdf7e268b410a38073ba25b2b8d797e8394df6ca344bee3ed2eb5ed93905cea84a1f9721b4a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unique_job (0.3.0.pre)
4
+ unique_job (0.3.1.pre)
5
5
  redis
6
6
  sidekiq (> 6.0, < 7.0)
7
7
 
@@ -13,22 +13,22 @@ module UniqueJob
13
13
  if unique_key.nil? || unique_key.to_s.empty?
14
14
  logger.warn { "[UniqueJob] Don't check a job with a blank key worker=#{worker.class} key=#{unique_key}" }
15
15
  yield
16
- elsif perform_unique_check(worker, args, unique_key.to_s)
16
+ elsif check_uniqueness(worker, unique_key.to_s)
17
17
  yield
18
+ else
19
+ logger.debug { "[UniqueJob] Duplicate job skipped worker=#{worker.class} key=#{unique_key}" }
20
+ perform_callback(worker, :after_skip, args)
21
+ nil
18
22
  end
19
23
  else
20
24
  yield
21
25
  end
22
26
  end
23
27
 
24
- def perform_unique_check(worker, args, unique_key)
28
+ def check_uniqueness(worker, unique_key)
25
29
  history = job_history(worker)
26
30
 
27
31
  if history.exists?(unique_key)
28
- logger.info { "[UniqueJob] Skip duplicate job worker=#{worker.class} key=#{unique_key}" }
29
-
30
- perform_callback(worker, :after_skip, args)
31
-
32
32
  false
33
33
  else
34
34
  history.add(unique_key)
@@ -1,3 +1,3 @@
1
1
  module UniqueJob
2
- VERSION = "0.3.0.pre"
2
+ VERSION = "0.3.1.pre"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unique_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre
4
+ version: 0.3.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - ts-3156