diff --git a/Build.PL b/Build.PL index 17de2b7..a17dcdf 100644 --- a/Build.PL +++ b/Build.PL @@ -5,7 +5,6 @@ my $builder = Module::Build->new( dist_author => 'Kirill Solomko ', dist_version_from => 'lib/NGCP/Cleanup.pm', requires => { - 'DateTime' => 0, }, ); $builder->create_build_script; diff --git a/debian/ngcp-cleanup-tools-ce.install b/debian/ngcp-cleanup-tools-ce.install index a4489e5..71cf9b3 100644 --- a/debian/ngcp-cleanup-tools-ce.install +++ b/debian/ngcp-cleanup-tools-ce.install @@ -1,3 +1,4 @@ +usr/share/perl5/NGCP/Cleanup.pm usr/share/perl5/NGCP/ acc-cleanup.conf etc/ngcp-cleanup-tools/ acc-cleanup.pl usr/sbin/ cleanup-old-cdr-files.pl usr/sbin/ diff --git a/debian/ngcp-cleanup-tools-pro.install b/debian/ngcp-cleanup-tools-pro.install index fab5c25..69ff836 100644 --- a/debian/ngcp-cleanup-tools-pro.install +++ b/debian/ngcp-cleanup-tools-pro.install @@ -1,3 +1,4 @@ +usr/share/perl5/NGCP/Cleanup.pm usr/share/perl5/NGCP/ acc-cleanup.conf etc/ngcp-cleanup-tools/ acc-cleanup.pl usr/sbin/ cleanup-old-cdr-files.pl usr/sbin/ diff --git a/lib/NGCP/Cleanup.pm b/lib/NGCP/Cleanup.pm index d0c7308..e714b8f 100755 --- a/lib/NGCP/Cleanup.pm +++ b/lib/NGCP/Cleanup.pm @@ -598,7 +598,7 @@ sub cleanup_table { DELETE FROM $table WHERE $col < date(date_sub(now(), interval ? day)) $limit SQL $deleted_rows += $aff; - last unless $aff; + last unless $aff > 0; } $self->debug("table=$table deleted rows=$deleted_rows"); }