activejob-uniqueness 0.3.0 → 0.3.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 +6 -1
- data/lib/active_job/uniqueness/lock_manager.rb +12 -2
- data/lib/active_job/uniqueness/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 120483e1019cb9e65e1f270ae21d040d17a37d54e7fa6616800cdc7ff8180251
|
4
|
+
data.tar.gz: c9b299e5e444e19cb1f2a3230447eb44ebd719bb2a93e3c0b2abe22f77782e47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5742577b735a3749612b194b6d8912a72938ffaab6b2cb470448fce0342c39a265e99a0fa043f405eaf90ef03f1844fa913331095d13a9a9f968ece3e75265fa
|
7
|
+
data.tar.gz: 4d22df0933705d5aa22fec6d47add7a6d61e6adab20afb9d8a0557cc6c35907d75491ac07a1bd0e71ea2e4fb59a6d6468ece7e8387c2ee954cc6e1078aa55326
|
data/CHANGELOG.md
CHANGED
@@ -3,8 +3,13 @@ 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.3.
|
6
|
+
## [Unreleased](https://github.com/veeqo/activejob-uniqueness/compare/v0.3.1...HEAD)
|
7
7
|
|
8
|
+
## [0.3.1](https://github.com/veeqo/activejob-uniqueness/compare/v0.3.0...v0.3.1) - 2023-10-30
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
- [#67](https://github.com/veeqo/activejob-uniqueness/pull/67) Random redis errors on delete_lock by [@laurafeier](https://github.com/laurafeier)
|
8
13
|
|
9
14
|
## [0.3.0](https://github.com/veeqo/activejob-uniqueness/compare/v0.2.5...v0.3.0) - 2023-10-20
|
10
15
|
|
@@ -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
|
12
|
+
synced_redis_connection(server) do |conn|
|
13
13
|
conn.call('DEL', resource)
|
14
14
|
end
|
15
15
|
end
|
@@ -20,13 +20,23 @@ module ActiveJob
|
|
20
20
|
# Unlocks multiple resources by key wildcard.
|
21
21
|
def delete_locks(wildcard)
|
22
22
|
@servers.each do |server|
|
23
|
-
server
|
23
|
+
synced_redis_connection(server) do |conn|
|
24
24
|
conn.scan('MATCH', wildcard).each { |key| conn.call('DEL', key) }
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
true
|
29
29
|
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def synced_redis_connection(server, &block)
|
34
|
+
if server.respond_to?(:synchronize)
|
35
|
+
server.synchronize(&block)
|
36
|
+
else
|
37
|
+
server.instance_variable_get(:@redis).with(&block)
|
38
|
+
end
|
39
|
+
end
|
30
40
|
end
|
31
41
|
end
|
32
42
|
end
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Sharshenov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|