|
|
@ -1595,7 +1595,9 @@ struct HTTPPool
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def client(region = nil, &block)
|
|
|
|
def client(region = nil, &block)
|
|
|
|
pool.connection do |conn|
|
|
|
|
conn = pool.checkout
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
if region
|
|
|
|
if region
|
|
|
|
PROXY_LIST[region]?.try &.sample(40).each do |proxy|
|
|
|
|
PROXY_LIST[region]?.try &.sample(40).each do |proxy|
|
|
|
|
begin
|
|
|
|
begin
|
|
|
@ -1607,7 +1609,6 @@ struct HTTPPool
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
response = yield conn
|
|
|
|
response = yield conn
|
|
|
|
conn.unset_proxy
|
|
|
|
conn.unset_proxy
|
|
|
|
response
|
|
|
|
response
|
|
|
@ -1617,7 +1618,8 @@ struct HTTPPool
|
|
|
|
conn.read_timeout = 5.seconds
|
|
|
|
conn.read_timeout = 5.seconds
|
|
|
|
conn.connect_timeout = 5.seconds
|
|
|
|
conn.connect_timeout = 5.seconds
|
|
|
|
yield conn
|
|
|
|
yield conn
|
|
|
|
end
|
|
|
|
ensure
|
|
|
|
|
|
|
|
pool.checkin(conn)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|