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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0239b2cca535272939571db36a7694c86008c0fc57dd1fd946c10c35b30f9160'
4
- data.tar.gz: f69616afd47037e85e3f248f9f4a398a00c99b91e3f484c547de82f1782de933
3
+ metadata.gz: b9dddeb211dc3682bcf52ea61c6fbae09b2f53b464dfc77be09d41e802c81451
4
+ data.tar.gz: 9235b96c6047126767f6412ad1bf0e216f2f3172e244caecdf22880256a852c6
5
5
  SHA512:
6
- metadata.gz: d0a0587190b5e6c93f51c8bbb4e31424173ebe8b31e33dfcbc070bda3bcc9daf557b0c39b7d9434e7d24fd4c8a0e68dda036f0113174b83b4f0e3ffc0b214188
7
- data.tar.gz: abb1515c6a31575ddea9b6e1b1f87ef386d0f5768f743a2c5d5218e563cef630522d9390ed7705c8bea5d9afa603f04128934fdc84ece66ec1c0b42f8d8f198c
6
+ metadata.gz: fe9167455f11e23771989414b78731394123d339884bf607acef3d11ab32e4b46f1cdd5e62b7fbac8e3e3443e6f31b8dcbf7f63a9f1c162544856d37f97282b9
7
+ data.tar.gz: f35d3fa2c117f58d946180d396e7bb39564def02d09cde27ebe60b107e2de6ab853a205fed52bc446029e2a56c8a0b4efd69758920ea39e1e5d407bdf8abae1f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,3 @@
1
- ## [Unreleased]
2
-
3
1
  ## [0.1.0] - 2023-09-07
4
2
 
5
3
  - Initial release
@@ -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
- # TODO: make this logic robust
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DelayedJobPreventDuplicate
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  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.0
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-07 00:00:00.000000000 Z
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