projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
limit memory use when upgrading attachments
[freeside.git]
/
FS
/
FS
/
otaker_Mixin.pm
diff --git
a/FS/FS/otaker_Mixin.pm
b/FS/FS/otaker_Mixin.pm
index
4aa47c3
..
0da9aee
100644
(file)
--- a/
FS/FS/otaker_Mixin.pm
+++ b/
FS/FS/otaker_Mixin.pm
@@
-40,11
+40,13
@@
sub _upgrade_otaker {
my $class = shift;
my $table = $class->table;
my $class = shift;
my $table = $class->table;
+ my $limit = ( $table eq 'cust_attachment' ? 10 : 1000 );
+
while ( 1 ) {
my @records = qsearch({
'table' => $table,
'hashref' => {},
while ( 1 ) {
my @records = qsearch({
'table' => $table,
'hashref' => {},
- 'extra_sql' =>
'WHERE otaker IS NOT NULL LIMIT 1000'
,
+ 'extra_sql' =>
"WHERE otaker IS NOT NULL LIMIT $limit"
,
});
last unless @records;
});
last unless @records;