redis_queued_locks 0.0.22 → 0.0.24

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: 4360a9af038cc33ca36215d729558bab6810b9c5a4fec7f31df6ca2871b7dd80
4
- data.tar.gz: 10b80a0f389994fde9a4815c3a5031ae85cee3c61d9c2a02e85d80146208bb99
3
+ metadata.gz: b0c873b666d2c9f618789e6ef957e1ce7375da840bcbc1ce797d9e457bcc7d72
4
+ data.tar.gz: 9f9c4637fae7ca1a1e8bdc247e23f5c11977af7962f545ae084d05126106dad0
5
5
  SHA512:
6
- metadata.gz: 362e7708a37f8716217e08117f072ef34d14886677379d28bef08f80c1a1a82e1309509dfc5fe4f748a3a10268bf340087c83e797ebcd72cb8172594352fb23d
7
- data.tar.gz: 32a0943ee8c80b8ed745dff8eeea748c2289008d8fb00d3e20c7b464ef14a4d21158066e548bb86cfebc73c5d61a365289b49ae8061bc3ea0339ad7bb3c9894d
6
+ metadata.gz: 06c3a4ee60f8c5da6d9272ed99bff10315496c79e6c922431529b7f34da896e17fb08c73b389080f82c54e3714d89780950517e3beff469661bbbf6c4bdbaf0e
7
+ data.tar.gz: a0d7c9287c0a22923f2ddd4573ec6be63c0e274cff23fb5b2744b9cbd44368b7803b1ced3ffe9eefc53f0f2f23729177641535835bb6f97ede5f79074a308c4f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.24] - 2024-03-21
4
+ ### Added
5
+ - An optional ability to log each try of lock obtaining (see `RedisQueuedLocks::Acquier::AcquireLock::TryToLock.try_to_lock`);
6
+
7
+ ## [0.0.23] - 2024-03-21
8
+ ### Changed
9
+ - Composed redis commands are invoked on the one conenction
10
+ (instead of mutiple connection fetchiong from redis connection pool on each redis command);
11
+
3
12
  ## [0.0.22] - 2024-03-21
4
13
  ### Added
5
14
  - Logging infrastructure. Initial implementation includes the only debugging features.
data/README.md CHANGED
@@ -144,6 +144,11 @@ clinet = RedisQueuedLocks::Client.new(redis_client) do |config|
144
144
  # - start of the lock expiration after `yield`: "[redis_queud_locks.expire_lock] lock_key => 'rql:lock:your_lock'"
145
145
  # - by default uses VoidLogger that does nothing;
146
146
  config.logger = RedisQueuedLocks::Logging::VoidLogger
147
+
148
+ # (default: false)
149
+ # - should be logged the each try of lock acquiring (a lot of logs can be generated depending on your retry configurations);
150
+ # - if logger is not cofnigured this option does not lead to any effect;
151
+ config.log_lock_try = false
147
152
  end
148
153
  ```
149
154
 
@@ -187,6 +192,8 @@ def lock(
187
192
  fail_fast: false,
188
193
  identity: uniq_identity, # (attr_accessor) calculated during client instantiation via config[:uniq_identifier] proc;
189
194
  metadata: nil,
195
+ logger: config[:logger],
196
+ log_lock_try: config[:log_lock_try],
190
197
  &block
191
198
  )
192
199
  ```
@@ -224,6 +231,12 @@ def lock(
224
231
  ivar (accessed via `uniq_dentity` accessor method);
225
232
  - `metadata` - `[NilClass,Any]`
226
233
  - A custom metadata wich will be passed to the instrumenter's payload with `:meta` key;
234
+ - `logger` - `[::Logger,#debug]`
235
+ - Logger object used from the configuration layer (see config[:logger]);
236
+ - See `RedisQueuedLocks::Logging::VoidLogger` for example;
237
+ - `log_lock_try` - `[Boolean]`
238
+ - should be logged the each try of lock acquiring (a lot of logs can be generated depending on your retry configurations);
239
+ - see `config[:log_lock_try]`;
227
240
  - `block` - `[Block]`
228
241
  - A block of code that should be executed after the successfully acquired lock.
229
242
  - If block is **passed** the obtained lock will be released after the block execution or it's ttl (what will happen first);
@@ -278,6 +291,8 @@ def lock!(
278
291
  identity: uniq_identity,
279
292
  fail_fast: false,
280
293
  metadata: nil,
294
+ logger: config[:logger],
295
+ log_lock_try: config[:log_lock_try],
281
296
  &block
282
297
  )
283
298
  ```
@@ -2,8 +2,14 @@
2
2
 
3
3
  # @api private
4
4
  # @since 0.1.0
5
+ # rubocop:disable Metrics/ModuleLength
5
6
  module RedisQueuedLocks::Acquier::AcquireLock::TryToLock
7
+ # @since 0.1.0
8
+ extend RedisQueuedLocks::Utilities
9
+
6
10
  # @param redis [RedisClient]
11
+ # @param logger [::Logger,#debug]
12
+ # @param log_lock_try [Boolean]
7
13
  # @param lock_key [String]
8
14
  # @param lock_key_queue [String]
9
15
  # @param acquier_id [String]
@@ -18,6 +24,8 @@ module RedisQueuedLocks::Acquier::AcquireLock::TryToLock
18
24
  # rubocop:disable Metrics/MethodLength
19
25
  def try_to_lock(
20
26
  redis,
27
+ logger,
28
+ log_lock_try,
21
29
  lock_key,
22
30
  lock_key_queue,
23
31
  acquier_id,
@@ -30,96 +38,114 @@ module RedisQueuedLocks::Acquier::AcquireLock::TryToLock
30
38
  inter_result = nil
31
39
  timestamp = nil
32
40
 
41
+ if log_lock_try
42
+ run_non_critical do
43
+ logger.debug("[redis_queued_locks.try_lock_start] lock_key => '#{lock_key}'")
44
+ end
45
+ end
46
+
33
47
  # Step 0: watch the lock key changes (and discard acquirement if lock is already acquired)
34
- result = redis.multi(watch: [lock_key]) do |transact|
35
- # Fast-Step X0: fail-fast check
36
- if fail_fast && redis.call('HGET', lock_key, 'acq_id')
37
- # Fast-Step X1: is lock already obtained. fail fast - no try.
38
- inter_result = :fail_fast_no_try
39
- else
40
- # Step 1: add an acquier to the lock acquirement queue
41
- res = redis.call('ZADD', lock_key_queue, 'NX', acquier_position, acquier_id)
42
-
43
- RedisQueuedLocks.debug(
44
- "Step №1: добавление в очередь (#{acquier_id}). [ZADD to the queue: #{res}]"
45
- )
46
-
47
- # Step 2.1: drop expired acquiers from the lock queue
48
- res = redis.call(
49
- 'ZREMRANGEBYSCORE',
50
- lock_key_queue,
51
- '-inf',
52
- RedisQueuedLocks::Resource.acquier_dead_score(queue_ttl)
53
- )
54
-
55
- RedisQueuedLocks.debug(
56
- "Step №2: дропаем из очереди просроченных ожидающих. [ZREMRANGE: #{res}]"
57
- )
58
-
59
- # Step 3: get the actual acquier waiting in the queue
60
- waiting_acquier = Array(redis.call('ZRANGE', lock_key_queue, '0', '0')).first
61
-
62
- RedisQueuedLocks.debug(
63
- "Step №3: какой процесс в очереди сейчас ждет. " \
64
- "[ZRANGE <следующий процесс>: #{waiting_acquier} :: <текущий процесс>: #{acquier_id}]"
65
- )
66
-
67
- # Step 4: check the actual acquier: is it ours? are we aready to lock?
68
- unless waiting_acquier == acquier_id
69
- # Step ROLLBACK 1.1: our time hasn't come yet. retry!
48
+ result = redis.with do |rconn|
49
+ if log_lock_try
50
+ run_non_critical do
51
+ logger.debug("[redis_queued_locks.try_lock_rconn_fetched] lock_key => '#{lock_key}'")
52
+ end
53
+ end
54
+
55
+ rconn.multi(watch: [lock_key]) do |transact|
56
+ # Fast-Step X0: fail-fast check
57
+ if fail_fast && rconn.call('HGET', lock_key, 'acq_id')
58
+ # Fast-Step X1: is lock already obtained. fail fast - no try.
59
+ inter_result = :fail_fast_no_try
60
+ else
61
+ # Step 1: add an acquier to the lock acquirement queue
62
+ res = rconn.call('ZADD', lock_key_queue, 'NX', acquier_position, acquier_id)
70
63
 
71
64
  RedisQueuedLocks.debug(
72
- "Step ROLLBACK №1: не одинаковые ключи. выходим. " \
73
- "[Ждет: #{waiting_acquier}. А нужен: #{acquier_id}]"
65
+ "Step №1: добавление в очередь (#{acquier_id}). [ZADD to the queue: #{res}]"
74
66
  )
75
67
 
76
- inter_result = :acquier_is_not_first_in_queue
77
- else
78
- # NOTE: our time has come! let's try to acquire the lock!
68
+ # Step 2.1: drop expired acquiers from the lock queue
69
+ res = rconn.call(
70
+ 'ZREMRANGEBYSCORE',
71
+ lock_key_queue,
72
+ '-inf',
73
+ RedisQueuedLocks::Resource.acquier_dead_score(queue_ttl)
74
+ )
79
75
 
80
- # Step 5: check if the our lock is already acquired
81
- locked_by_acquier = redis.call('HGET', lock_key, 'acq_id')
76
+ RedisQueuedLocks.debug(
77
+ "Step №2: дропаем из очереди просроченных ожидающих. [ZREMRANGE: #{res}]"
78
+ )
79
+
80
+ # Step 3: get the actual acquier waiting in the queue
81
+ waiting_acquier = Array(rconn.call('ZRANGE', lock_key_queue, '0', '0')).first
82
82
 
83
83
  RedisQueuedLocks.debug(
84
- "Ste5: Ищем требуемый лок. " \
85
- "[HGET<#{lock_key}>: " \
86
- "#{(locked_by_acquier == nil) ? 'не занят' : "занят процессом <#{locked_by_acquier}>"}"
84
+ "Step3: какой процесс в очереди сейчас ждет. " \
85
+ "[ZRANGE <следующий процесс>: #{waiting_acquier} :: <текущий процесс>: #{acquier_id}]"
87
86
  )
88
87
 
89
- if locked_by_acquier
90
- # Step ROLLBACK 2: required lock is stil acquired. retry!
88
+ # Step 4: check the actual acquier: is it ours? are we aready to lock?
89
+ unless waiting_acquier == acquier_id
90
+ # Step ROLLBACK 1.1: our time hasn't come yet. retry!
91
91
 
92
92
  RedisQueuedLocks.debug(
93
- "Step ROLLBACK №2: Ключ уже занят. Ничего не делаем. " \
94
- "[Занят процессом: #{locked_by_acquier}]"
93
+ "Step ROLLBACK №1: не одинаковые ключи. выходим. " \
94
+ "[Ждет: #{waiting_acquier}. А нужен: #{acquier_id}]"
95
95
  )
96
96
 
97
- inter_result = :lock_is_still_acquired
97
+ inter_result = :acquier_is_not_first_in_queue
98
98
  else
99
- # NOTE: required lock is free and ready to be acquired! acquire!
100
-
101
- # Step 6.1: remove our acquier from waiting queue
102
- transact.call('ZPOPMIN', lock_key_queue, '1')
99
+ # NOTE: our time has come! let's try to acquire the lock!
103
100
 
104
- RedisQueuedLocks.debug(
105
- 'Step №4: Забираем наш текущий процесс из очереди. [ZPOPMIN]'
106
- )
101
+ # Step 5: check if the our lock is already acquired
102
+ locked_by_acquier = rconn.call('HGET', lock_key, 'acq_id')
107
103
 
104
+ # rubocop:disable Layout/LineLength
108
105
  RedisQueuedLocks.debug(
109
- "===> <FINAL> Step 6: закрепляем лок за процессом [HSET<#{lock_key}>: #{acquier_id}]"
106
+ "Ste5: Ищем требуемый лок. " \
107
+ "[HGET<#{lock_key}>: " \
108
+ "#{(locked_by_acquier == nil) ? 'не занят' : "занят процессом <#{locked_by_acquier}>"}"
110
109
  )
111
-
112
- # Step 6.2: acquire a lock and store an info about the acquier
113
- transact.call(
114
- 'HSET',
115
- lock_key,
116
- 'acq_id', acquier_id,
117
- 'ts', (timestamp = Time.now.to_i),
118
- 'ini_ttl', ttl
119
- )
120
-
121
- # Step 6.3: set the lock expiration time in order to prevent "infinite locks"
122
- transact.call('PEXPIRE', lock_key, ttl) # NOTE: in milliseconds
110
+ # rubocop:enable Layout/LineLength
111
+
112
+ if locked_by_acquier
113
+ # Step ROLLBACK 2: required lock is stil acquired. retry!
114
+
115
+ RedisQueuedLocks.debug(
116
+ "Step ROLLBACK №2: Ключ уже занят. Ничего не делаем. " \
117
+ "[Занят процессом: #{locked_by_acquier}]"
118
+ )
119
+
120
+ inter_result = :lock_is_still_acquired
121
+ else
122
+ # NOTE: required lock is free and ready to be acquired! acquire!
123
+
124
+ # Step 6.1: remove our acquier from waiting queue
125
+ transact.call('ZPOPMIN', lock_key_queue, '1')
126
+
127
+ RedisQueuedLocks.debug(
128
+ 'Step №4: Забираем наш текущий процесс из очереди. [ZPOPMIN]'
129
+ )
130
+
131
+ # rubocop:disable Layout/LineLength
132
+ RedisQueuedLocks.debug(
133
+ "===> <FINAL> Step №6: закрепляем лок за процессом [HSET<#{lock_key}>: #{acquier_id}]"
134
+ )
135
+ # rubocop:enable Layout/LineLength
136
+
137
+ # Step 6.2: acquire a lock and store an info about the acquier
138
+ transact.call(
139
+ 'HSET',
140
+ lock_key,
141
+ 'acq_id', acquier_id,
142
+ 'ts', (timestamp = Time.now.to_i),
143
+ 'ini_ttl', ttl
144
+ )
145
+
146
+ # Step 6.3: set the lock expiration time in order to prevent "infinite locks"
147
+ transact.call('PEXPIRE', lock_key, ttl) # NOTE: in milliseconds
148
+ end
123
149
  end
124
150
  end
125
151
  end
@@ -176,3 +202,4 @@ module RedisQueuedLocks::Acquier::AcquireLock::TryToLock
176
202
  RedisQueuedLocks::Data[ok: true, result: result]
177
203
  end
178
204
  end
205
+ # rubocop:enable Metrics/ModuleLength
@@ -7,7 +7,7 @@ module RedisQueuedLocks::Acquier::AcquireLock::YieldWithExpire
7
7
  extend RedisQueuedLocks::Utilities
8
8
 
9
9
  # @param redis [RedisClient] Redis connection manager.
10
- # @param logger [#debug] Logger object.
10
+ # @param logger [::Logger,#debug] Logger object.
11
11
  # @param lock_key [String] Lock key to be expired.
12
12
  # @param timed [Boolean] Should the lock be wrapped by Tiemlout with with lock's ttl
13
13
  # @param ttl_shift [Float] Lock's TTL shifting. Should affect block's ttl. In millisecodns.
@@ -69,9 +69,13 @@ module RedisQueuedLocks::Acquier::AcquireLock
69
69
  # already obtained.
70
70
  # @option metadata [NilClass,Any]
71
71
  # - A custom metadata wich will be passed to the instrumenter's payload with :meta key;
72
- # @option logger [#debug]
73
- # - Logger object used from `configuration` layer (see config[:logger]);
72
+ # @option logger [::Logger,#debug]
73
+ # - Logger object used from the configuration layer (see config[:logger]);
74
74
  # - See RedisQueuedLocks::Logging::VoidLogger for example;
75
+ # @option log_lock_try [Boolean]
76
+ # - should be logged the each try of lock acquiring (a lot of logs can be generated depending
77
+ # on your retry configurations);
78
+ # - see `config[:log_lock_try]`;
75
79
  # @param [Block]
76
80
  # A block of code that should be executed after the successfully acquired lock.
77
81
  # @return [RedisQueuedLocks::Data,Hash<Symbol,Any>,yield]
@@ -100,6 +104,7 @@ module RedisQueuedLocks::Acquier::AcquireLock
100
104
  fail_fast:,
101
105
  metadata:,
102
106
  logger:,
107
+ log_lock_try:,
103
108
  &block
104
109
  )
105
110
  # Step 1: prepare lock requirements (generate lock name, calc lock ttl, etc).
@@ -146,6 +151,8 @@ module RedisQueuedLocks::Acquier::AcquireLock
146
151
  while acq_process[:should_try]
147
152
  try_to_lock(
148
153
  redis,
154
+ logger,
155
+ log_lock_try,
149
156
  lock_key,
150
157
  lock_key_queue,
151
158
  acquier_id,
@@ -7,7 +7,7 @@ module RedisQueuedLocks::Acquier::ExtendLockTTL
7
7
  # @param redis_client [RedisClient]
8
8
  # @param lock_name [String]
9
9
  # @param milliseconds [Integer]
10
- # @param logger [#debug]
10
+ # @param logger [::Logger,#debug]
11
11
  # @return [?]
12
12
  #
13
13
  # @api private
@@ -17,7 +17,7 @@ module RedisQueuedLocks::Acquier::ReleaseAllLocks
17
17
  # The number of lock keys that should be released in a time.
18
18
  # @param isntrumenter [#notify]
19
19
  # See RedisQueuedLocks::Instrument::ActiveSupport for example.
20
- # @param logger [#debug]
20
+ # @param logger [::Logger,#debug]
21
21
  # - Logger object used from `configuration` layer (see config[:logger]);
22
22
  # - See RedisQueuedLocks::Logging::VoidLogger for example;
23
23
  # @return [RedisQueuedLocks::Data,Hash<Symbol,Any>]
@@ -57,26 +57,28 @@ module RedisQueuedLocks::Acquier::ReleaseAllLocks
57
57
  # @api private
58
58
  # @since 0.1.0
59
59
  def fully_release_all_locks(redis, batch_size)
60
- result = redis.pipelined do |pipeline|
61
- # Step A: release all queus and their related locks
62
- redis.scan(
63
- 'MATCH',
64
- RedisQueuedLocks::Resource::LOCK_QUEUE_PATTERN,
65
- count: batch_size
66
- ) do |lock_queue|
67
- # TODO: reduce unnecessary iterations
68
- pipeline.call('ZREMRANGEBYSCORE', lock_queue, '-inf', '+inf')
69
- pipeline.call('EXPIRE', RedisQueuedLocks::Resource.lock_key_from_queue(lock_queue), '0')
70
- end
60
+ result = redis.with do |rconn|
61
+ rconn.pipelined do |pipeline|
62
+ # Step A: release all queus and their related locks
63
+ rconn.scan(
64
+ 'MATCH',
65
+ RedisQueuedLocks::Resource::LOCK_QUEUE_PATTERN,
66
+ count: batch_size
67
+ ) do |lock_queue|
68
+ # TODO: reduce unnecessary iterations
69
+ pipeline.call('ZREMRANGEBYSCORE', lock_queue, '-inf', '+inf')
70
+ pipeline.call('EXPIRE', RedisQueuedLocks::Resource.lock_key_from_queue(lock_queue), '0')
71
+ end
71
72
 
72
- # Step B: release all locks
73
- redis.scan(
74
- 'MATCH',
75
- RedisQueuedLocks::Resource::LOCK_PATTERN,
76
- count: batch_size
77
- ) do |lock_key|
78
- # TODO: reduce unnecessary iterations
79
- pipeline.call('EXPIRE', lock_key, '0')
73
+ # Step B: release all locks
74
+ rconn.scan(
75
+ 'MATCH',
76
+ RedisQueuedLocks::Resource::LOCK_PATTERN,
77
+ count: batch_size
78
+ ) do |lock_key|
79
+ # TODO: reduce unnecessary iterations
80
+ pipeline.call('EXPIRE', lock_key, '0')
81
+ end
80
82
  end
81
83
  end
82
84
 
@@ -20,7 +20,7 @@ module RedisQueuedLocks::Acquier::ReleaseLock
20
20
  # The lock name that should be released.
21
21
  # @param isntrumenter [#notify]
22
22
  # See RedisQueuedLocks::Instrument::ActiveSupport for example.
23
- # @param logger [#debug]
23
+ # @param logger [::Logger,#debug]
24
24
  # - Logger object used from `configuration` layer (see config[:logger]);
25
25
  # - See RedisQueuedLocks::Logging::VoidLogger for example;
26
26
  # @return [RedisQueuedLocks::Data,Hash<Symbol,Any>]
@@ -65,9 +65,11 @@ module RedisQueuedLocks::Acquier::ReleaseLock
65
65
  # @api private
66
66
  # @since 0.1.0
67
67
  def fully_release_lock(redis, lock_key, lock_key_queue)
68
- result = redis.multi do |transact|
69
- transact.call('ZREMRANGEBYSCORE', lock_key_queue, '-inf', '+inf')
70
- transact.call('EXPIRE', lock_key, '0')
68
+ result = redis.with do |rconn|
69
+ rconn.multi do |transact|
70
+ transact.call('ZREMRANGEBYSCORE', lock_key_queue, '-inf', '+inf')
71
+ transact.call('EXPIRE', lock_key, '0')
72
+ end
71
73
  end
72
74
 
73
75
  RedisQueuedLocks::Data[ok: true, result:]
@@ -19,6 +19,7 @@ class RedisQueuedLocks::Client
19
19
  setting :instrumenter, RedisQueuedLocks::Instrument::VoidNotifier
20
20
  setting :uniq_identifier, -> { RedisQueuedLocks::Resource.calc_uniq_identity }
21
21
  setting :logger, RedisQueuedLocks::Logging::VoidLogger
22
+ setting :log_lock_try, false
22
23
 
23
24
  validate('retry_count') { |val| val == nil || (val.is_a?(::Integer) && val >= 0) }
24
25
  validate('retry_delay') { |val| val.is_a?(::Integer) && val >= 0 }
@@ -28,8 +29,9 @@ class RedisQueuedLocks::Client
28
29
  validate('default_queue_ttl', :integer)
29
30
  validate('lock_release_batch_size', :integer)
30
31
  validate('instrumenter') { |val| RedisQueuedLocks::Instrument.valid_interface?(val) }
31
- validate('logger') { |val| RedisQueuedLocks::Logging.valid_interface?(val) }
32
32
  validate('uniq_identifier', :proc)
33
+ validate('logger') { |val| RedisQueuedLocks::Logging.valid_interface?(val) }
34
+ validate('log_lock_try', :boolean)
33
35
  end
34
36
 
35
37
  # @return [RedisClient]
@@ -93,6 +95,13 @@ class RedisQueuedLocks::Client
93
95
  # by another process while the lock request queue was initially empty;
94
96
  # @option metadata [NilClass,Any]
95
97
  # - A custom metadata wich will be passed to the instrumenter's payload with :meta key;
98
+ # @option logger [::Logger,#debug]
99
+ # - Logger object used from the configuration layer (see config[:logger]);
100
+ # - See `RedisQueuedLocks::Logging::VoidLogger` for example;
101
+ # @option log_lock_try [Boolean]
102
+ # - should be logged the each try of lock acquiring (a lot of logs can
103
+ # be generated depending on your retry configurations);
104
+ # - see `config[:log_lock_try]`;
96
105
  # @param block [Block]
97
106
  # A block of code that should be executed after the successfully acquired lock.
98
107
  # @return [RedisQueuedLocks::Data,Hash<Symbol,Any>,yield]
@@ -114,6 +123,8 @@ class RedisQueuedLocks::Client
114
123
  fail_fast: false,
115
124
  identity: uniq_identity,
116
125
  metadata: nil,
126
+ logger: config[:logger],
127
+ log_lock_try: config[:log_lock_try],
117
128
  &block
118
129
  )
119
130
  RedisQueuedLocks::Acquier::AcquireLock.acquire_lock(
@@ -136,6 +147,7 @@ class RedisQueuedLocks::Client
136
147
  fail_fast:,
137
148
  metadata:,
138
149
  logger: config[:logger],
150
+ log_lock_try: config[:log_lock_try],
139
151
  &block
140
152
  )
141
153
  end
@@ -156,6 +168,8 @@ class RedisQueuedLocks::Client
156
168
  fail_fast: false,
157
169
  identity: uniq_identity,
158
170
  metadata: nil,
171
+ logger: config[:logger],
172
+ log_lock_try: config[:log_lock_try],
159
173
  &block
160
174
  )
161
175
  lock(
@@ -6,7 +6,7 @@ module RedisQueuedLocks::Logging
6
6
  require_relative 'logging/void_logger'
7
7
 
8
8
  class << self
9
- # @param logger [#debug]
9
+ # @param logger [::Logger,#debug]
10
10
  # @return [Boolean]
11
11
  #
12
12
  # @api public
@@ -5,6 +5,6 @@ module RedisQueuedLocks
5
5
  #
6
6
  # @api public
7
7
  # @since 0.0.1
8
- # @version 0.0.22
9
- VERSION = '0.0.22'
8
+ # @version 0.0.24
9
+ VERSION = '0.0.24'
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_queued_locks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov