activejob-uniqueness 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -2
- data/lib/active_job/uniqueness/lock_key.rb +1 -1
- data/lib/active_job/uniqueness/lock_manager.rb +2 -2
- data/lib/active_job/uniqueness/log_subscriber.rb +2 -3
- data/lib/active_job/uniqueness/version.rb +1 -1
- data/lib/active_job/uniqueness.rb +4 -0
- data/lib/generators/active_job/uniqueness/templates/config/initializers/active_job_uniqueness.rb +1 -1
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be824ecac1e864d000509ee27bb2a19a41bf1c0dbbb92fe49517a5a7fe1c86ff
|
4
|
+
data.tar.gz: a0d50fcdea9e48a952f6574604f3286b4de994b780299b99434c04f8ca0d16b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e890759b54e003eea294906ed47055f71065ad8763538d1ada3c4985ebbed3492f4ce8ee91f6d732222e1b206d1caff023d8d73f019072642c0bd8873da870cf
|
7
|
+
data.tar.gz: 878c1af167966d9093ffacf90e919e78d8a5de57a92ae68f7475f4717b4e777af95ab413c27d77d86000fa328b6167d7d2e841c3ff9eee7379cc6e573d3b91ff
|
data/CHANGELOG.md
CHANGED
@@ -3,13 +3,23 @@ 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.
|
6
|
+
## [Unreleased](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.4...HEAD)
|
7
|
+
|
8
|
+
|
9
|
+
## [0.2.4](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.3...v0.2.4) - 2022-06-22
|
10
|
+
|
11
|
+
### Added
|
12
|
+
- [#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)
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
- [#42](https://github.com/veeqo/activejob-uniqueness/pull/42) Actualize rubies and gems for tests
|
7
17
|
|
8
18
|
## [0.2.3](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.2...v0.2.3) - 2022-02-28
|
9
19
|
|
10
20
|
### Added
|
11
21
|
- [#36](https://github.com/veeqo/activejob-uniqueness/pull/36) Support ActiveJob/Rails 7.0
|
12
|
-
- [#37](https://github.com/veeqo/activejob-uniqueness/pull/37) Add Ruby 3.1 to CI by [@petergoldstein]
|
22
|
+
- [#37](https://github.com/veeqo/activejob-uniqueness/pull/37) Add Ruby 3.1 to CI by [@petergoldstein](https://github.com/petergoldstein)
|
13
23
|
|
14
24
|
## [0.2.2](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.1...v0.2.2) - 2021-10-22
|
15
25
|
|
@@ -9,7 +9,7 @@ module ActiveJob
|
|
9
9
|
# Unlocks a resource by resource only.
|
10
10
|
def delete_lock(resource)
|
11
11
|
@servers.each do |server|
|
12
|
-
server.instance_variable_get(
|
12
|
+
server.instance_variable_get(:@redis).with do |conn|
|
13
13
|
conn.del resource
|
14
14
|
end
|
15
15
|
end
|
@@ -20,7 +20,7 @@ module ActiveJob
|
|
20
20
|
# Unlocks multiple resources by key wildcard.
|
21
21
|
def delete_locks(wildcard)
|
22
22
|
@servers.each do |server|
|
23
|
-
server.instance_variable_get(
|
23
|
+
server.instance_variable_get(:@redis).with do |conn|
|
24
24
|
conn.scan_each(match: wildcard).each { |key| conn.del key }
|
25
25
|
end
|
26
26
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'active_support/log_subscriber'
|
4
4
|
|
5
5
|
module ActiveJob
|
6
|
-
class LogSubscriber < ActiveSupport::LogSubscriber
|
6
|
+
class LogSubscriber < ActiveSupport::LogSubscriber # :nodoc:
|
7
7
|
def lock(event)
|
8
8
|
job = event.payload[:job]
|
9
9
|
resource = event.payload[:resource]
|
@@ -66,8 +66,7 @@ module ActiveJob
|
|
66
66
|
|
67
67
|
def args_info(job)
|
68
68
|
if job.arguments.any? && log_arguments?(job)
|
69
|
-
|
70
|
-
job.arguments.map { |arg| format(arg).inspect }.join(', ')
|
69
|
+
" with arguments: #{job.arguments.map { |arg| format(arg).inspect }.join(', ')}"
|
71
70
|
else
|
72
71
|
''
|
73
72
|
end
|
data/lib/generators/active_job/uniqueness/templates/config/initializers/active_job_uniqueness.rb
CHANGED
@@ -15,7 +15,7 @@ ActiveJob::Uniqueness.configure do |config|
|
|
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
|
18
|
-
# proc - custom Proc. For example, ->(job) { job.logger.info(
|
18
|
+
# proc - custom Proc. For example, ->(job) { job.logger.info("Job already in queue: #{job.class.name} #{job.arguments.inspect} (#{job.job_id})") }
|
19
19
|
#
|
20
20
|
# config.on_conflict = :raise
|
21
21
|
|
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
|
+
version: 0.2.4
|
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-
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -106,6 +106,34 @@ dependencies:
|
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '3.0'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: rubocop
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - "~>"
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '1.28'
|
116
|
+
type: :development
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '1.28'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: rubocop-rspec
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '2.10'
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '2.10'
|
109
137
|
description: Ensure uniqueness of your ActiveJob jobs
|
110
138
|
email:
|
111
139
|
- rustam@sharshenov.com
|
@@ -143,6 +171,7 @@ metadata:
|
|
143
171
|
homepage_uri: https://github.com/veeqo/activejob-uniqueness
|
144
172
|
source_code_uri: https://github.com/veeqo/activejob-uniqueness
|
145
173
|
changelog_uri: https://github.com/veeqo/activejob-uniqueness/blob/main/CHANGELOG.md
|
174
|
+
rubygems_mfa_required: 'true'
|
146
175
|
post_install_message:
|
147
176
|
rdoc_options: []
|
148
177
|
require_paths:
|