delayed_job_prevent_duplicate 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +0 -2
- data/lib/delayed_duplicate_prevention_plugin.rb +4 -9
- data/lib/delayed_job_prevent_duplicate/version.rb +1 -1
- metadata +2 -3
- data/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9dddeb211dc3682bcf52ea61c6fbae09b2f53b464dfc77be09d41e802c81451
|
4
|
+
data.tar.gz: 9235b96c6047126767f6412ad1bf0e216f2f3172e244caecdf22880256a852c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe9167455f11e23771989414b78731394123d339884bf607acef3d11ab32e4b46f1cdd5e62b7fbac8e3e3443e6f31b8dcbf7f63a9f1c162544856d37f97282b9
|
7
|
+
data.tar.gz: f35d3fa2c117f58d946180d396e7bb39564def02d09cde27ebe60b107e2de6ab853a205fed52bc446029e2a56c8a0b4efd69758920ea39e1e5d407bdf8abae1f
|
data/CHANGELOG.md
CHANGED
@@ -23,19 +23,19 @@ class DelayedDuplicatePreventionPlugin < Delayed::Plugin
|
|
23
23
|
pobj = payload_object
|
24
24
|
if pobj.object.respond_to?(:id) and pobj.object.id.present?
|
25
25
|
sig = "#{pobj.object.class}"
|
26
|
-
sig += ":#{pobj.object.id}"
|
26
|
+
sig += ":#{pobj.object.id}"
|
27
27
|
else
|
28
28
|
sig = "#{pobj.object}"
|
29
29
|
end
|
30
30
|
|
31
31
|
sig += "##{pobj.method_name}"
|
32
32
|
return sig
|
33
|
-
end
|
33
|
+
end
|
34
34
|
|
35
35
|
def prevent_duplicate
|
36
36
|
if DuplicateChecker.duplicate?(self)
|
37
37
|
Rails.logger.warn "Found duplicate job(#{self.signature}), ignoring..."
|
38
|
-
errors.add(:base, "This is a duplicate")
|
38
|
+
errors.add(:base, "This is a duplicate")
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -65,12 +65,7 @@ class DelayedDuplicatePreventionPlugin < Delayed::Plugin
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def args_match?(job1, job2)
|
68
|
-
|
69
|
-
normalize_args(job1.args) == normalize_args(job2.args)
|
70
|
-
end
|
71
|
-
|
72
|
-
def normalize_args(args)
|
73
|
-
args.kind_of?(String) ? YAML.load(args) : args
|
68
|
+
job1.payload_object.args == job2.payload_object.args
|
74
69
|
end
|
75
70
|
end
|
76
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job_prevent_duplicate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pabois
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: delayed_job
|
@@ -38,7 +38,6 @@ executables: []
|
|
38
38
|
extensions: []
|
39
39
|
extra_rdoc_files: []
|
40
40
|
files:
|
41
|
-
- ".DS_Store"
|
42
41
|
- CHANGELOG.md
|
43
42
|
- Gemfile
|
44
43
|
- LICENSE.txt
|
data/.DS_Store
DELETED
Binary file
|