# DO NOT EDIT - This file is being maintained by Chef
-require 'expire'
-
-tile_dirs = [
-<% node[:tile][:styles].each do |name,details| -%>
- "/srv/tile.openstreetmap.org/tiles/<%= name %>",
-<% end -%>
+args = [
+ "--socket=/var/run/renderd/renderd.sock",
+ "--tile-dir=/srv/tile.openstreetmap.org/tiles",
+ "--touch-from=13",
+ "--min-zoom=13"
]
-max_zoom = <%= node[:tile][:styles].collect { |n,d| d[:max_zoom] }.max %>
-
-ARGV.each do |f|
- Expire::expire(f, 13, max_zoom, tile_dirs)
+Dir.glob("/var/lib/replicate/expire-queue/changes-*.txt").sort.each do |f|
+ <% node[:tile][:styles].each do |name,details| -%>
+ system("/usr/bin/render_expired", "--map=<%= name %>", *args, "--max-zoom=<%= details[:max_zoom] %>", :in=> f) &&
+ <% end -%>
+ File::unlink(f)
end