activejob-uniqueness 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be824ecac1e864d000509ee27bb2a19a41bf1c0dbbb92fe49517a5a7fe1c86ff
4
- data.tar.gz: a0d50fcdea9e48a952f6574604f3286b4de994b780299b99434c04f8ca0d16b1
3
+ metadata.gz: 705386dd2f0c394a53f42b2051dfde2545ed65f74dc1a54f4a177a9f89bcb385
4
+ data.tar.gz: 41ae721426c8e02035f8150fd5be55f63d645f3df0cdb39c6f5119cf06d6e2cd
5
5
  SHA512:
6
- metadata.gz: e890759b54e003eea294906ed47055f71065ad8763538d1ada3c4985ebbed3492f4ce8ee91f6d732222e1b206d1caff023d8d73f019072642c0bd8873da870cf
7
- data.tar.gz: 878c1af167966d9093ffacf90e919e78d8a5de57a92ae68f7475f4717b4e777af95ab413c27d77d86000fa328b6167d7d2e841c3ff9eee7379cc6e573d3b91ff
6
+ metadata.gz: 0fac130eadc83e0aee35567aa7e1f780bc1086b61eb658af01576672d5023bbc82cf2f97faef5429770dd4b26645973fba010bb1df69eee9b606f5307aafe734
7
+ data.tar.gz: 238eddea7dccfcb9c00e863872c837747ccafe2c4df8ecc12085ceb85dc843551f791889b05f4c0e3b1b890efe4c69c74ecca3875c23feaeb9fd783baf69e57d
data/CHANGELOG.md CHANGED
@@ -3,14 +3,35 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
 
6
- ## [Unreleased](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.4...HEAD)
6
+ ## [Unreleased](https://github.com/veeqo/activejob-uniqueness/compare/v0.3.0...HEAD)
7
7
 
8
8
 
9
+ ## [0.3.0](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.5...v0.3.0) - 2023-10-20
10
+
11
+ ### Added
12
+ - [#66](https://github.com/veeqo/activejob-uniqueness/pull/66) Activejob 7.1 support by [@laurafeier](https://github.com/laurafeier)
13
+
14
+ ### Changed
15
+ - [#57](https://github.com/veeqo/activejob-uniqueness/pull/57) Upgrade to Redlock 2 & use redis-client by [@bmulholland](https://github.com/bmulholland)
16
+
17
+ ### Removed
18
+ - Support fo Redlock v1 is removed. Switching to `RedisClient` is [a breaking change of Redlock v2](https://github.com/leandromoreira/redlock-rb/blob/main/CHANGELOG.md#200---2023-02-09).
19
+
20
+ ## [0.2.5](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.4...v0.2.5) - 2023-02-01
21
+
22
+ ### Added
23
+ - [#45](https://github.com/veeqo/activejob-uniqueness/pull/45) Add Dependabot for GitHub Actions by [@petergoldstein](https://github.com/petergoldstein)
24
+ - [#51](https://github.com/veeqo/activejob-uniqueness/pull/51) Add support for Sidekiq 7 by [@dwightwatson](https://github.com/dwightwatson)
25
+ - [#52](https://github.com/veeqo/activejob-uniqueness/pull/52) Add Ruby 3.2.0 to the CI matrix by [@petergoldstein](https://github.com/petergoldstein)
26
+
27
+ ### Changed
28
+ - [#46](https://github.com/veeqo/activejob-uniqueness/pull/46) Fix a method name typo in CHANGELOG by [@y-yagi](https://github.com/y-yagi)
29
+
9
30
  ## [0.2.4](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.3...v0.2.4) - 2022-06-22
10
31
 
11
32
  ### Added
12
33
  - [#43](https://github.com/veeqo/activejob-uniqueness/pull/43) Run rubocop on Github Actions
13
- - [#44](https://github.com/veeqo/activejob-uniqueness/pull/44) Add ActiveJob::Uniqueness.test_mode! method to reset lock manager by [@akostadinov](https://github.com/akostadinov)
34
+ - [#44](https://github.com/veeqo/activejob-uniqueness/pull/44) Add ActiveJob::Uniqueness.reset_manager! method to reset lock manager by [@akostadinov](https://github.com/akostadinov)
14
35
 
15
36
  ### Changed
16
37
  - [#42](https://github.com/veeqo/activejob-uniqueness/pull/42) Actualize rubies and gems for tests
@@ -10,7 +10,7 @@ module ActiveJob
10
10
  def delete_lock(resource)
11
11
  @servers.each do |server|
12
12
  server.instance_variable_get(:@redis).with do |conn|
13
- conn.del resource
13
+ conn.call('DEL', resource)
14
14
  end
15
15
  end
16
16
 
@@ -21,7 +21,7 @@ module ActiveJob
21
21
  def delete_locks(wildcard)
22
22
  @servers.each do |server|
23
23
  server.instance_variable_get(:@redis).with do |conn|
24
- conn.scan_each(match: wildcard).each { |key| conn.del key }
24
+ conn.scan('MATCH', wildcard).each { |key| conn.call('DEL', key) }
25
25
  end
26
26
  end
27
27
 
@@ -91,6 +91,8 @@ end
91
91
 
92
92
  # Global death handlers are introduced in Sidekiq 5.1
93
93
  # https://github.com/mperham/sidekiq/blob/e7acb124fbeb0bece0a7c3d657c39a9cc18d72c6/Changes.md#510
94
- if sidekiq_version >= Gem::Version.new('5.1')
94
+ if sidekiq_version >= Gem::Version.new('7.0')
95
+ Sidekiq.default_configuration.death_handlers << ->(job, _ex) { ActiveJob::Uniqueness.unlock_sidekiq_job!(job) }
96
+ elsif sidekiq_version >= Gem::Version.new('5.1')
95
97
  Sidekiq.death_handlers << ->(job, _ex) { ActiveJob::Uniqueness.unlock_sidekiq_job!(job) }
96
98
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveJob
4
4
  module Uniqueness
5
- VERSION = '0.2.4'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  ActiveJob::Uniqueness.configure do |config|
4
4
  # Global default expiration for lock keys. Each job can define its own ttl via :lock_ttl option.
5
- # Stategy :until_and_while_executing also accept :on_runtime_ttl option.
5
+ # Strategy :until_and_while_executing also accepts :on_runtime_ttl option.
6
6
  #
7
7
  # config.lock_ttl = 1.day
8
8
 
@@ -11,7 +11,7 @@ ActiveJob::Uniqueness.configure do |config|
11
11
  # config.lock_prefix = 'activejob_uniqueness'
12
12
 
13
13
  # Default action on lock conflict. Can be set per job.
14
- # Stategy :until_and_while_executing also accept :on_runtime_conflict option.
14
+ # Strategy :until_and_while_executing also accepts :on_runtime_conflict option.
15
15
  # Allowed values are
16
16
  # :raise - raises ActiveJob::Uniqueness::JobNotUnique
17
17
  # :log - instruments ActiveSupport::Notifications and logs event to the ActiveJob::Logger
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activejob-uniqueness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Sharshenov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-22 00:00:00.000000000 Z
11
+ date: 2023-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '7.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,27 +29,27 @@ dependencies:
29
29
  version: '4.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '7.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: redlock
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '1.2'
39
+ version: '2.0'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '2'
42
+ version: '3'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '1.2'
49
+ version: '2.0'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '2'
52
+ version: '3'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: appraisal
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -82,16 +82,16 @@ dependencies:
82
82
  name: pry-byebug
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ">="
85
+ - - ">"
86
86
  - !ruby/object:Gem::Version
87
- version: '0'
87
+ version: 3.6.0
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ">="
92
+ - - ">"
93
93
  - !ruby/object:Gem::Version
94
- version: '0'
94
+ version: 3.6.0
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rspec
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.1.6
190
+ rubygems_version: 3.2.33
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Ensure uniqueness of your ActiveJob jobs