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