upgrade optimizations for space-constrained installs, RT10071
authorlevinse <levinse>
Sun, 23 Jan 2011 22:04:30 +0000 (22:04 +0000)
committerlevinse <levinse>
Sun, 23 Jan 2011 22:04:30 +0000 (22:04 +0000)
FS/FS/otaker_Mixin.pm
FS/bin/freeside-daily

index 8d9c882..af61a85 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use Carp qw( croak ); #confess );
 use FS::Record qw( qsearch qsearchs );
 use FS::access_user;
+use FS::UID qw( dbh );
 
 sub otaker {
   my $self = shift;
@@ -76,6 +77,11 @@ sub _upgrade_otaker {
       my $error = $record->replace;
       die $error if $error;
     }
+        
+    if ( $table eq 'cust_attachment' ) {
+       warn "  committing (cust_attachment) \n";
+       dbh->commit or die dbh->errstr;
+    }
 
   }
 
index ee3cda6..0b770f6 100755 (executable)
@@ -54,6 +54,10 @@ backup_scp();
 use FS::Cron::rt_tasks qw(rt_escalate);
 rt_escalate(%opt);
 
+my $deldir = "$FS::UID::cache_dir/cache.$FS::UID::datasrc/";
+unlink <${deldir}.invoice*>;
+unlink <${deldir}.letter*>;
+
 ###
 # subroutines
 ###