X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/016c7dfacda321c44808f179a0ec4e66954336cc..96d19c738aa00a6390f0c63472139305fb8ef739:/cookbooks/tile/templates/default/expire-tiles.erb diff --git a/cookbooks/tile/templates/default/expire-tiles.erb b/cookbooks/tile/templates/default/expire-tiles.erb index 1a8a01a26..2f6a97d77 100644 --- a/cookbooks/tile/templates/default/expire-tiles.erb +++ b/cookbooks/tile/templates/default/expire-tiles.erb @@ -2,17 +2,14 @@ # DO NOT EDIT - This file is being maintained by Chef -require 'expire' - -tile_dirs = [ +args = [ <% node[:tile][:styles].each do |name,details| -%> - "/srv/tile.openstreetmap.org/tiles/<%= name %>", + "-t", "/srv/tile.openstreetmap.org/tiles/<%= name %>", <% end -%> + "--min", "13", + "--max", "<%= node[:tile][:styles].collect { |n,d| d[:max_zoom] }.max %>" ] -max_zoom = <%= node[:tile][:styles].collect { |n,d| d[:max_zoom] }.max %> - Dir.glob("/var/lib/replicate/expire-queue/changes-*.gz").each do |f| - Expire::expire(f, 13, max_zoom, tile_dirs) - File::unlink(f) + system("/usr/local/bin/expire-tiles-single", *args, f) && File::unlink(f) end