From 8fb72dc273ac45e1a6746b3c3caabc9da2efa97d Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Fri, 23 Mar 2018 12:19:08 +0100 Subject: [PATCH] TT#34653 fix module install and cleanup rows check * ensure that the library is installed and available on CE/PRO * fix cleanup_rows check Change-Id: I15f4ebcbb750de5388159e71318655a8dc471bf7 --- Build.PL | 1 - debian/ngcp-cleanup-tools-ce.install | 1 + debian/ngcp-cleanup-tools-pro.install | 1 + lib/NGCP/Cleanup.pm | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) 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"); }