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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 705386dd2f0c394a53f42b2051dfde2545ed65f74dc1a54f4a177a9f89bcb385
4
- data.tar.gz: 41ae721426c8e02035f8150fd5be55f63d645f3df0cdb39c6f5119cf06d6e2cd
3
+ metadata.gz: 120483e1019cb9e65e1f270ae21d040d17a37d54e7fa6616800cdc7ff8180251
4
+ data.tar.gz: c9b299e5e444e19cb1f2a3230447eb44ebd719bb2a93e3c0b2abe22f77782e47
5
5
  SHA512:
6
- metadata.gz: 0fac130eadc83e0aee35567aa7e1f780bc1086b61eb658af01576672d5023bbc82cf2f97faef5429770dd4b26645973fba010bb1df69eee9b606f5307aafe734
7
- data.tar.gz: 238eddea7dccfcb9c00e863872c837747ccafe2c4df8ecc12085ceb85dc843551f791889b05f4c0e3b1b890efe4c69c74ecca3875c23feaeb9fd783baf69e57d
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.0...HEAD)
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.instance_variable_get(:@redis).with do |conn|
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.instance_variable_get(:@redis).with do |conn|
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveJob
4
4
  module Uniqueness
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  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.0
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-20 00:00:00.000000000 Z
11
+ date: 2023-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob