tile: remove potential infinite loop in tile cleanup script
authorGrant Slater <git@firefishy.com>
Wed, 11 Sep 2013 17:15:28 +0000 (18:15 +0100)
committerGrant Slater <git@firefishy.com>
Wed, 11 Sep 2013 17:15:28 +0000 (18:15 +0100)
cookbooks/tile/templates/default/cleanup-tiles.erb

index 31a7fadd99c43c212ef84b1889462bd9e86b96f3..e58e0bdbfafb4d5995ebb6a802e0d3221c4e5b96 100644 (file)
@@ -17,7 +17,7 @@ if (df($tiledir)->{per} > 90)
 
     open(TILES, "-|", "sort", "-n", $tempfile) || die "Can't open $tempfile: $!";
 
-    while (df($tiledir)->{per} > 80)
+    while (df($tiledir)->{per} > 80  && ! eof(TILES))
     {
         for my $n (1..1000)
         {