From edb9dbcdb71d38d0707e1da419d56c620004bb18 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 1 Sep 2023 19:53:36 +0100 Subject: [PATCH] Log how many tiles we expire --- cookbooks/tile/files/default/bin/expire-tiles-single | 10 +++++++--- cookbooks/tile/recipes/default.rb | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cookbooks/tile/files/default/bin/expire-tiles-single b/cookbooks/tile/files/default/bin/expire-tiles-single index 30b41c343..431021b2e 100644 --- a/cookbooks/tile/files/default/bin/expire-tiles-single +++ b/cookbooks/tile/files/default/bin/expire-tiles-single @@ -80,9 +80,10 @@ def xyz_to_meta(x, y, z, meta_size): def expire_meta(meta): """Expire the meta tile by setting the modified time back. """ - if os.path.exists(meta): - print("Expiring " + meta) + exists = os.path.exists(meta) + if exists: os.utime(meta, (EXPIRY_TIME, EXPIRY_TIME)) + return exists def expire_meta_tiles(options): @@ -106,8 +107,11 @@ def expire_meta_tiles(options): new_set.add((int(xy[0]/2), int(xy[1]/2), xy[2] - 1)) # expire all meta tiles + expired = 0 for meta in meta_set: - expire_meta(meta) + if expire_meta(meta): + expired += 1 + print("Expired {0} tiles at zoom {1}".format(expired, z)) # continue with parent tiles tile_set = new_set diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index f642aafb8..f693f4382 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -555,7 +555,6 @@ systemd_service "expire-tiles" do user "_renderd" exec_start "/usr/local/bin/expire-tiles" nice 10 - standard_output "null" sandbox true read_write_paths tile_directories + [ "/store/database/nodes", -- 2.39.5