Method: Datadog::Core::Utils::OnlyOnceSuccessful#run
- Defined in:
- lib/datadog/core/utils/only_once_successful.rb
#run ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/datadog/core/utils/only_once_successful.rb', line 29 def run @mutex.synchronize do return if @ran_once result = yield @ran_once = !!result if !@ran_once && limited? @retries += 1 check_limit! end result end end |