class Resque::Kubernetes::RetriableClient

Wraps Kubeclient::Client to retry timeout errors

Attributes

kubeclient[RW]

Public Class Methods

new(client) click to toggle source
# File lib/resque/kubernetes/retriable_client.rb, line 9
def initialize(client)
  self.kubeclient = client
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/resque/kubernetes/retriable_client.rb, line 13
def method_missing(method, *args, &block)
  if kubeclient.respond_to?(method)
    Retriable.retriable(on: {Kubeclient::HttpError => /Timed out/}) do
      kubeclient.send(method, *args, &block)
    end
  else
    super
  end
end
respond_to_missing?(method) click to toggle source
# File lib/resque/kubernetes/retriable_client.rb, line 23
def respond_to_missing?(method)
  kubeclient.respond_to?(method)
end