]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tile/templates/default/render-lowzoom.erb
Lower energy_perf_bias on power limited azure-01/02
[chef.git] / cookbooks / tile / templates / default / render-lowzoom.erb
1 #!/bin/bash
2
3 # DO NOT EDIT - This file is being maintained by Chef
4
5 # Get current time
6 timestamp=$(date +%s)
7 <% node[:tile][:styles].each_key do |style| -%>
8
9 # Define function to update tiles from z0 to z12 for style "<%= style %>"
10 function update_<%= style %>
11 {
12   render_old \
13     --timestamp=${timestamp} \
14     --tile-dir=/srv/tile.openstreetmap.org/tiles \
15     --socket=/run/renderd/renderd.sock \
16     --num-threads=<%= @threads %> \
17     --map="<%= style %>" \
18     --max-load=<%= node.cpu_cores - 1 %> \
19     --min-zoom=0 --max-zoom=12
20 }
21
22 max_tries=120
23 count=0
24
25 # Loop running the update command until it succeeds
26 until update_<%= style %>
27 do
28   count=$((count + 1))
29   if [ "$count" -ge "$max_tries" ]; then
30     echo "Aborting <%= style %> after $max_tries failed attempts"
31     break
32   fi
33   sleep 30
34 done
35 <% end -%>
36
37 exit 0