Module: RedisQueuedLocks::Acquirer::ReleaseAllLocks Private
- Extended by:
- Utilities
- Defined in:
- lib/redis_queued_locks/acquirer/release_all_locks.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.
Constant Summary
Constants included from Utilities
Utilities::RACTOR_LIVENESS_PATTERN, Utilities::RACTOR_STATUS_PATTERN, Utilities::RUBY_OVER_4
Class Method Summary collapse
-
.release_all_locks(redis, batch_size, 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,Any>
private
Release all locks: - 1.
Methods included from Utilities
clock_gettime, ractor_alive?, ractor_status, ruby_over_4?, run_non_critical, thread_state
Class Method Details
.release_all_locks(redis, batch_size, 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,Any>
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.
Release all locks:
-
- clear all lock queus: drop them all from Redis database by the lock queue pattern;
-
- delete all locks: drop lock keys from Redis by the lock key pattern;
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/redis_queued_locks/acquirer/release_all_locks.rb', line 75 def release_all_locks( redis, batch_size, 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 ) rel_start_time = clock_gettime fully_release_all_locks(redis, batch_size) => { ok:, result: } # steep:ignore # @type var ok: bool # @type var result: Hash[Symbol,Integer] time_at = Time.now.to_f rel_end_time = clock_gettime rel_time = ((rel_end_time - rel_start_time) / 1_000.0).ceil(2) instr_sampled = RedisQueuedLocks::Instrument.should_instrument?( instr_sampling_enabled, instr_sample_this, instr_sampling_percent, instr_sampler ) run_non_critical do instrumenter.notify('redis_queued_locks.explicit_all_locks_release', { at: time_at, rel_time: rel_time, rel_key_cnt: result[:rel_key_cnt] }) end if instr_sampled { ok: true, result: { rel_key_cnt: result[:rel_key_cnt], rel_time: rel_time } } end |