]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/replicate.erb
Use .osc.gz for diffs that tile replication fetches
[chef.git] / cookbooks / tile / templates / default / replicate.erb
index 1b6c61bbc96f588ee5810a9f6e71b9cfce5ffd86..9d86d9534b0bd198140fcffc3ce4b7bafbd45df2 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
@@ -68,16 +68,16 @@ do
 
             # Apply the changes to the database
 <% if node[:tile][:node_file] -%>
-            osm2pgsql --slim --append --number-processes=1 --flat-nodes=<%= node[:tile][:node_file] %> ${file}
+            osm2pgsql --database gis --slim --append --number-processes=1 --flat-nodes=<%= node[:tile][:node_file] %> ${file}
 <% else -%>
-            osm2pgsql --slim --append --number-processes=1 ${file}
+            osm2pgsql --database gis --slim --append --number-processes=1 ${file}
 <% end -%>
 
             # 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