From 7858dd015372cf109c3d75b3a09ec4b3fcb029d2 Mon Sep 17 00:00:00 2001 From: Andrew Pogrebennyk Date: Fri, 25 May 2012 11:31:06 +0000 Subject: [PATCH] fix bug with infinite loop in cleanup --- acc-cleanup.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acc-cleanup.pl b/acc-cleanup.pl index ddd90bb..55d7f47 100755 --- a/acc-cleanup.pl +++ b/acc-cleanup.pl @@ -106,7 +106,7 @@ sub cleanup { my $col = $vars{"time-column"}; while (1) { - my $aff = $dbh->do("delete from $table where $col < date_sub(now(), interval ? day) $limit", + my $aff = $dbh->do("delete from $table where $col < date(date_sub(now(), interval ? day)) $limit", undef, $vars{"cleanup-days"}); $aff or die("Unable to delete records from $table"); $aff == 0 and last;