lib/http_crawler/client.rb in http_crawler-0.3.1.8 vs lib/http_crawler/client.rb in http_crawler-0.3.1.9
- old
+ new
@@ -182,17 +182,17 @@
break
end
sleep(5)
end while true
proxy_ip = proxy_ip.symbolize_keys
- Rails.logger.debug("当前IP => #{@proxy},获取最新代理 => #{proxy_ip}")
unless proxy_ip[:p_addr] && proxy_ip[:p_port]
Rails.logger.warn "无最新代理等待5秒后重新获取:p_addr 或 p_port 为空"
sleep(5)
proxy_ip = get_proxy
end
+ Rails.logger.info("当前IP => #{@proxy},切换至代理 => #{proxy_ip}")
proxy_ip
end
attr_accessor :error_urls