Skip to content

Commit

Permalink
add open/read timeout kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvanw committed Mar 23, 2021
1 parent 76e3cb8 commit c053118
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/prometheus/client/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Push

attr_reader :job, :instance, :gateway, :path

def initialize(job, instance = nil, gateway = nil)
def initialize(job, instance = nil, gateway = nil, **kwargs)
@mutex = Mutex.new
@job = job
@instance = instance
Expand All @@ -30,6 +30,8 @@ def initialize(job, instance = nil, gateway = nil)

@http = Net::HTTP.new(@uri.host, @uri.port)
@http.use_ssl = (@uri.scheme == 'https')
@http.open_timeout = kwargs[:open_timeout] if kwargs[:open_timeout]
@http.read_timeout = kwargs[:read_timeout] if kwargs[:read_timeout]
end

def add(registry)
Expand Down

0 comments on commit c053118

Please sign in to comment.