Randomly refresh HTTP clients

pull/3/head
Omar Roth 2018-01-19 18:51:57 +00:00
rodzic 61e3b47210
commit f77dcb7f9b
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -21,9 +21,12 @@ end
# Refresh all the connections in the pool by crawling recommended
spawn do
# Arbitrary start value
id = Deque.new(50,"0xjKNDMgE54")
id = Deque.new(50, "0xjKNDMgE54")
while true
client = get_client
if rand(30) > 1
client = HTTP::Client.new(URL, CONTEXT)
end
time = Time.now
begin