projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2ae2595
)
Block a scale used by a scraper
author
Tom Hughes
<tom@compton.nu>
Wed, 30 Nov 2016 01:21:13 +0000
(
01:21
+0000)
committer
Tom Hughes
<tom@compton.nu>
Wed, 30 Nov 2016 01:21:13 +0000
(
01:21
+0000)
cookbooks/tile/templates/default/export.erb
patch
|
blob
|
history
diff --git
a/cookbooks/tile/templates/default/export.erb
b/cookbooks/tile/templates/default/export.erb
index c05083835b43b28a65564001dd97957c39dfe071..b91c3957f349b8ff52f5eb07ba2e922314606de9 100644
(file)
--- a/
cookbooks/tile/templates/default/export.erb
+++ b/
cookbooks/tile/templates/default/export.erb
@@
-70,6
+70,9
@@
idletime = cputimes[3] / sum(cputimes)
if idletime < 0.2:
# Abort if the CPU idle time on the machine is too low
output_error("The server is too busy at the moment. Please wait a few minutes before trying again.", "503 Service Unavailable")
if idletime < 0.2:
# Abort if the CPU idle time on the machine is too low
output_error("The server is too busy at the moment. Please wait a few minutes before trying again.", "503 Service Unavailable")
+elif form.getvalue("scale") == "4600":
+ # Block scraper
+ output_error("The server is too busy at the moment. Please wait a few minutes before trying again.", "503 Service Unavailable")
<% @blocks["user_agents"].each do |user_agent| -%>
elif os.environ['HTTP_USER_AGENT'] == '<%= user_agent %>':
# Block scraper
<% @blocks["user_agents"].each do |user_agent| -%>
elif os.environ['HTTP_USER_AGENT'] == '<%= user_agent %>':
# Block scraper