]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/replicate.erb
Avoid duplicate resource names for wordpress plugins and themes
[chef.git] / cookbooks / tile / templates / default / replicate.erb
index 1b6c61bbc96f588ee5810a9f6e71b9cfce5ffd86..aa69177ecaa2679e8994a25f47242be42f3c2892 100644 (file)
@@ -28,7 +28,7 @@ trap onexit EXIT
 while true
 do
     # Work out the name of the next file
-    file="changes-${sequenceNumber}.osm.gz"
+    file="changes-${sequenceNumber}.osc.gz"
 
     # Save state file so we can rollback if an error occurs
     cp state.txt state-prev.txt
@@ -67,17 +67,22 @@ do
             echo "Fetched new data from ${prevSequenceNumber} to ${sequenceNumber} into ${file}"
 
             # Apply the changes to the database
+            osm2pgsql --database gis --slim --append --number-processes=1 \
 <% if node[:tile][:node_file] -%>
-            osm2pgsql --slim --append --number-processes=1 --flat-nodes=<%= node[:tile][:node_file] %> ${file}
-<% else -%>
-            osm2pgsql --slim --append --number-processes=1 ${file}
+                      --flat-nodes=<%= node[:tile][:node_file] %> \
 <% end -%>
+<% if node[:tile][:styles][:default][:revision] >= "v4.0.0" -%>
+                      --multi-geometry --hstore \
+                      --style=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.style \
+                      --tag-transform-script=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.lua \
+<% end -%>
+                      ${file}
 
             # No need to rollback now
             rm state-prev.txt
 
-            # Expire tiles which are touched by the changes
-            sudo -u www-data /usr/local/bin/expire-tiles ${file} > /dev/null 2>&1 &
+            # Queue these changes for expiry processing
+            ln ${file} expire-queue/$file
         fi
 
         # Delete old downloads