Sha256: 6fe951013823e223b9e4f41a42aed0e2c0c547f897bfa09f5255e6b10b121441

Contents?: true

Size: 245 Bytes

Versions: 3

Compression:

Stored size: 245 Bytes

Contents

module Sphinx
  class SafeExecutor
    def self.execute(timeout = 5, attempts = 3, &block)
      Sphinx::Timeout.timeout(timeout, &block)
    rescue ::Timeout::Error
      attempts -= 1
      raise if attempts <= 0
      retry
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
kpumuk-rlibsphinxclient-0.2.0 lib/sphinx/safe_executor.rb
kpumuk-rlibsphinxclient-0.2.1 lib/sphinx/safe_executor.rb
rlibsphinxclient-0.2.2 lib/sphinx/safe_executor.rb