[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.8-80-g0e4ce5c

Emannuel Lacour elacour at bestpractical.com
Wed Jun 9 05:02:33 EDT 2010


The branch, 3.8-trunk has been updated
       via  0e4ce5cf03d2a8c27549b62dc58b8e5267ef0b24 (commit)
      from  e3d012c1165fbdf5954ecd760c25e8830e01d273 (commit)

Summary of changes:
 etc/upgrade/shrink_cgm_table.pl          |    6 ++++++
 etc/upgrade/shrink_transactions_table.pl |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 0e4ce5cf03d2a8c27549b62dc58b8e5267ef0b24
Author: Emmanuel Lacour <elacour at easter-eggs.com>
Date:   Wed Jun 9 11:01:55 2010 +0200

    Shrink scrips may take long time, so print progress as percent.

diff --git a/etc/upgrade/shrink_cgm_table.pl b/etc/upgrade/shrink_cgm_table.pl
index 3d153c7..319cbbc 100644
--- a/etc/upgrade/shrink_cgm_table.pl
+++ b/etc/upgrade/shrink_cgm_table.pl
@@ -43,8 +43,14 @@ $cgms->Limit(
     ENTRYAGGREGATOR => 'AND',
 );
 
+$| = 1;
+my $total = $cgms->Count;
+my $i = 0;
+
 FetchNext( $cgms, 'init' );
 while ( my $rec = FetchNext( $cgms ) ) {
+    $i++;
+    printf("\r%0.2f %%", 100 * $i / $total);
     $RT::Handle->BeginTransaction;
     my ($status) = $rec->Delete;
     unless ($status) {
diff --git a/etc/upgrade/shrink_transactions_table.pl b/etc/upgrade/shrink_transactions_table.pl
index c5dc4b6..5db9843 100644
--- a/etc/upgrade/shrink_transactions_table.pl
+++ b/etc/upgrade/shrink_transactions_table.pl
@@ -43,8 +43,14 @@ $txns->Limit(
     ENTRYAGGREGATOR => 'AND',
 );
 
+$| = 1;
+my $total = $txns->Count;
+my $i = 0;
+
 FetchNext( $txns, 'init' );
 while ( my $rec = FetchNext( $txns ) ) {
+    $i++;
+    printf("\r%0.2f %%", 100 * $i / $total);
     $RT::Handle->BeginTransaction;
     my ($status) = $rec->Delete;
     unless ($status) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list