]> git.openstreetmap.org Git - chef.git/commitdiff
Correct idle time test
authorTom Hughes <tom@compton.nu>
Thu, 16 Apr 2015 13:57:11 +0000 (14:57 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 16 Apr 2015 13:57:11 +0000 (14:57 +0100)
cookbooks/tile/templates/default/export.erb

index 921361563cc56201f9ba68cabc0850670720858c..97aa161f66a06596ceed18dfdc45fd5892add5eb 100644 (file)
@@ -61,7 +61,7 @@ cputimes = [float(n) for n in open("/proc/stat").readline().rstrip().split()[1:-
 idletime = cputimes[3] / sum(cputimes)
 
 # Process the request
 idletime = cputimes[3] / sum(cputimes)
 
 # Process the request
-if idletime < 20:
+if idletime < 0.2:
   # Abort if the CPU idle time on the machine is too low
   print "Status: 503 Service Unavailable"
   output_error("The server is too busy at the moment. Please wait a few minutes before trying again.")
   # Abort if the CPU idle time on the machine is too low
   print "Status: 503 Service Unavailable"
   output_error("The server is too busy at the moment. Please wait a few minutes before trying again.")