Module: RedisQueuedLocks::Acquirer::ClearDeadRequests Private
- Defined in:
- lib/redis_queued_locks/acquirer/clear_dead_requests.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
Class Method Details
.clear_dead_requests(redis_client, scan_size, dead_ttl, logger, instrumenter, instrument, log_sampling_enabled, log_sampling_percent, log_sampler, log_sample_this, instr_sampling_enabled, instr_sampling_percent, instr_sampler, instr_sample_this) ⇒ Hash<Symbol,Boolean|Hash<Symbol,Set<String>>>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/redis_queued_locks/acquirer/clear_dead_requests.rb', line 26 def clear_dead_requests( redis_client, scan_size, dead_ttl, logger, instrumenter, instrument, log_sampling_enabled, log_sampling_percent, log_sampler, log_sample_this, instr_sampling_enabled, instr_sampling_percent, instr_sampler, instr_sample_this ) dead_score = RedisQueuedLocks::Resource.acquirer_dead_score(dead_ttl / 1_000.0) # @type var result: Set[String] result = Set.new.tap do |processed_queues| # @type var processed_queues: Set[String] redis_client.with do |rconn| each_lock_queue(rconn, scan_size) do |lock_queue| rconn.call('ZREMRANGEBYSCORE', lock_queue, '-inf', dead_score) processed_queues << lock_queue end end end { ok: true, result: { processed_queues: result } } end |