projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
649cb6a
)
limit memory use when upgrading attachments
author
ivan
<ivan>
Sun, 25 Jul 2010 07:30:42 +0000
(07:30 +0000)
committer
ivan
<ivan>
Sun, 25 Jul 2010 07:30:42 +0000
(07:30 +0000)
FS/FS/otaker_Mixin.pm
patch
|
blob
|
history
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 $limit = ( $table eq 'cust_attachment' ? 10 : 1000 );
+
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;