unique_job 0.2.1 → 0.3.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile.lock +7 -10
- data/lib/unique_job/util.rb +4 -4
- data/lib/unique_job/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b63e8007f726ff6fa7024e33e896356a0f0a8165b811ef8df75fa890275e498
|
4
|
+
data.tar.gz: 763c15b9b7b7f68c98977c9c12fb91ab000fa3b884de9992de6a37d34a28c390
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e5231116d67db01e395a3788b54d9a94cf94dd0ea691fe6feff2a5e7f7a79008b9b011badce76074dd03bd1c4857a633b6cc1975644a313b5d0c633f5ba6e7
|
7
|
+
data.tar.gz: dcc61ef6f05b02d7bb8a285e429ff7499332341ba2ba10a7a6f6609e8505dbf065f227aa08eec3460b9c981f7cc5ae2c5977ba9aeecf9355ec21c85904d675af
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
unique_job (0.
|
4
|
+
unique_job (0.3.0.pre)
|
5
5
|
redis
|
6
6
|
sidekiq (> 6.0, < 7.0)
|
7
7
|
|
@@ -9,17 +9,14 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
connection_pool (2.2.3)
|
12
|
-
minitest (5.
|
13
|
-
rack (2.2.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
redis (4.2.1)
|
18
|
-
sidekiq (6.0.7)
|
12
|
+
minitest (5.14.2)
|
13
|
+
rack (2.2.3)
|
14
|
+
rake (12.3.3)
|
15
|
+
redis (4.2.2)
|
16
|
+
sidekiq (6.1.2)
|
19
17
|
connection_pool (>= 2.2.2)
|
20
18
|
rack (~> 2.0)
|
21
|
-
|
22
|
-
redis (>= 4.1.0)
|
19
|
+
redis (>= 4.2.0)
|
23
20
|
|
24
21
|
PLATFORMS
|
25
22
|
ruby
|
data/lib/unique_job/util.rb
CHANGED
@@ -8,9 +8,10 @@ module UniqueJob
|
|
8
8
|
def perform_if_unique(worker, args, &block)
|
9
9
|
if worker.respond_to?(:unique_key)
|
10
10
|
unique_key = worker.unique_key(*args)
|
11
|
+
logger.debug { "[UniqueJob] Calculate unique key worker=#{worker.class} key=#{unique_key}" }
|
11
12
|
|
12
13
|
if unique_key.nil? || unique_key.to_s.empty?
|
13
|
-
logger.warn { "
|
14
|
+
logger.warn { "[UniqueJob] Don't check a job with a blank key worker=#{worker.class} key=#{unique_key}" }
|
14
15
|
yield
|
15
16
|
elsif perform_unique_check(worker, args, unique_key.to_s)
|
16
17
|
yield
|
@@ -24,7 +25,7 @@ module UniqueJob
|
|
24
25
|
history = job_history(worker)
|
25
26
|
|
26
27
|
if history.exists?(unique_key)
|
27
|
-
logger.info { "
|
28
|
+
logger.info { "[UniqueJob] Skip duplicate job worker=#{worker.class} key=#{unique_key}" }
|
28
29
|
|
29
30
|
perform_callback(worker, :after_skip, args)
|
30
31
|
|
@@ -59,8 +60,7 @@ module UniqueJob
|
|
59
60
|
worker.send(callback_name, *args)
|
60
61
|
end
|
61
62
|
rescue ArgumentError => e
|
62
|
-
|
63
|
-
raise ArgumentError.new("#{self.class}:#{worker.class} #{message} callback_name=#{callback_name} args=#{args.inspect} parameters=#{parameters.inspect}")
|
63
|
+
raise ArgumentError.new("[UniqueJob] Invalid parameters callback=#{callback_name}")
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
data/lib/unique_job/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unique_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ts-3156
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -52,6 +52,7 @@ extensions: []
|
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
54
|
- ".gitignore"
|
55
|
+
- ".ruby-version"
|
55
56
|
- ".travis.yml"
|
56
57
|
- CODE_OF_CONDUCT.md
|
57
58
|
- Gemfile
|
@@ -87,12 +88,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
88
|
version: 2.3.0
|
88
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
90
|
requirements:
|
90
|
-
- - "
|
91
|
+
- - ">"
|
91
92
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
93
|
+
version: 1.3.1
|
93
94
|
requirements: []
|
94
|
-
|
95
|
-
rubygems_version: 2.7.6
|
95
|
+
rubygems_version: 3.1.6
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Set a uniqueness to Sidekiq jobs
|