Action/Trigger load environment via stream
authorBill Erickson <berick@esilibrary.com>
Thu, 22 Aug 2013 20:47:27 +0000 (16:47 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 23 Sep 2013 17:13:06 +0000 (13:13 -0400)
Load objects in the A/T environment via streaming response instead of
atomic, to avoid very large messages.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm

index b0be015..e8d2f7e 100644 (file)
@@ -573,12 +573,15 @@ sub _object_by_path {
             my $def_id = $self->event->event_def->id;
             my $str_path = join('.', @$path);
 
+            my @params = (($multi) ? { $ffield => $lval } : $lval);
+            @params = ([@params], {substream => 1}) if $meth =~ /^search/;
+
             $obj = $_object_by_path_cache{$def_id}{$str_path}{$fhint}{$step}{$ffield}{$lval} ||
                 (
                     (grep /cstore/, @{
                         OpenILS::Application->publish_fieldmapper->{$fclass}{controller}
                     }) ? $ed : ($red ||= new_rstore_editor(xact=>1))
-                )->$meth( ($multi) ? { $ffield => $lval } : $lval);
+                )->$meth(@params);
 
             $_object_by_path_cache{$def_id}{$str_path}{$fhint}{$step}{$ffield}{$lval} ||= $obj;
         }