]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/cleanup-tiles.erb
Stop tile cleanup locks being considered stalfe after an hour
[chef.git] / cookbooks / tile / templates / default / cleanup-tiles.erb
index 0f9bff288e16f0027a01828628efe1b5d185c4ca..eebcd41a4f15ec8e1e1a2bdc6795c3ad1592d5b7 100644 (file)
@@ -11,9 +11,9 @@ use LockFile::Simple;
 
 my $tiledir = shift @ARGV;
 
-my $lockmgr = LockFile::Simple->make(-autoclean => 1, -max => 0, -warn => 0);
+my $lockmgr = LockFile::Simple->make(-autoclean => 1, -max => 1, -hold => 0, -warn => 0);
 
-$lockmgr->lock($tiledir) || exit 0;
+$lockmgr->lock("${tiledir}/cleanup") || exit 0;
 
 my $tempfile = tmpnam();
 
@@ -51,6 +51,6 @@ if (df($tiledir)->{per} > 90)
 
 unlink($tempfile);
 
-$lockmgr->unlock($tiledir);
+$lockmgr->unlock("${tiledir}/cleanup");
 
 exit 0;