sleep and raise on IP ban
This commit is contained in:
@@ -148,6 +148,12 @@ class Scraper::HttpClient
|
||||
sleep 15
|
||||
end
|
||||
|
||||
if content_type =~ /text\/plain/ && response_body =~ /Your IP address has been temporarily banned/
|
||||
logger.error("IP temp banned, sleeping & raising...")
|
||||
sleep 60 * 5
|
||||
raise
|
||||
end
|
||||
|
||||
reporter.write_point(
|
||||
"http_client_response",
|
||||
tags: {
|
||||
|
||||
Reference in New Issue
Block a user