sleep and raise on IP ban

This commit is contained in:
Dylan Knutson
2023-04-14 14:36:24 -07:00
parent dc4c1b1df9
commit 75503e2a99

View File

@@ -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: {