Sha256: 8317a3a43be89cd0eece4e6de0ab2bf5db8ad8d9af7f3c53815750a5a96e2530

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

class ProconBypassMan::DeviceConnection::Command
  MAX_RETRY_COUNT = 3

  # @return [void]
  def self.execute!(retry_count: 0)
    begin
      gadget, procon = ProconBypassMan::DeviceConnection::Executer.execute!
    rescue ProconBypassMan::DeviceConnection::TimeoutErrorInConditionalRoute
      if retry_count >= MAX_RETRY_COUNT
        ProconBypassMan::SendErrorCommand.execute(error: "リトライしましたが、接続できませんでした")
        raise ProconBypassMan::DeviceConnection::TimeoutError
      else
        ProconBypassMan::SendErrorCommand.execute(error: "接続に失敗したのでリトライします")
      end

      retry_count = retry_count + 1
      retry
    rescue ProconBypassMan::DeviceConnection::NotFoundProconError => e
      raise
    rescue ProconBypassMan::SafeTimeout::Timeout
      raise ProconBypassMan::DeviceConnection::TimeoutError
    end

    ProconBypassMan::DeviceConnection::PreBypass.new(gadget: gadget, procon: procon).execute!
    ProconBypassMan::DeviceConnection::ProconSettingOverrider.new(procon: procon).execute!
    return [gadget, procon]
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.10 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.9 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.8.1 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.8 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.7 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.6 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.5 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.4 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.3.1 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.3 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.2 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.1 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.3.0 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.2.3 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.2.2 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.2.1 lib/procon_bypass_man/device_connection/command.rb
procon_bypass_man-0.2.0 lib/procon_bypass_man/device_connection/command.rb