[open-ils-commits] [GIT] Evergreen ILS branch master updated. b324da25918a0382cba2ceac9d419121a3d1b5ae

Evergreen Git git at git.evergreen-ils.org
Thu Feb 9 16:50:31 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  b324da25918a0382cba2ceac9d419121a3d1b5ae (commit)
      from  e8857f2ae267956136b9f4ee3f3263c11ea2c7ae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b324da25918a0382cba2ceac9d419121a3d1b5ae
Author: Mike Rylander <mrylander at gmail.com>
Date:   Mon Oct 17 12:27:04 2011 -0400

    Stream results from targetable holds list retrieval
    
    Tested and slightly modified patch from Mike R. to improve multi-session
    hold targeting.  This patch includes an update to the targetable holds
    API call to stream results instead of returning them in 1 big chunk,
    which has been known to result in messages too large for jabber
    (max_stanza_size).  hold_targer.pl is updated to handle the stream.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
index 10f309f..2beaae5 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
@@ -346,8 +346,8 @@ sub targetable_holds {
     SQL
     my $sth = action::hold_request->db_Main->prepare_cached($query);
     $sth->execute($check_expire);
+    $client->respond( $_ ) for @{ $sth->fetchall_arrayref };
 
-    $client->respond( $_ ) for ( $sth->fetchall_arrayref );
     return undef;
 }
 
diff --git a/Open-ILS/src/support-scripts/hold_targeter.pl b/Open-ILS/src/support-scripts/hold_targeter.pl
index 84c5ba2..cd62227 100755
--- a/Open-ILS/src/support-scripts/hold_targeter.pl
+++ b/Open-ILS/src/support-scripts/hold_targeter.pl
@@ -56,13 +56,17 @@ if ($parallel == 1) {
     );
 
     my $storage = OpenSRF::AppSession->create("open-ils.storage");
-    my $holds = $storage->request('open-ils.storage.action.hold_request.targetable_holds.id_list', '24h')->gather();
-    $storage->disconnect();
 
-    foreach my $hold (@$holds) {
-        $multi_targeter->request( 'open-ils.storage.action.hold_request.copy_targeter', '', $hold->[0], $hold->[1]);
+    my $r = $storage->request('open-ils.storage.action.hold_request.targetable_holds.id_list', '24h');
+    while ( my $h = $r->recv ) {
+        die $r->failed->stringify . "\n" if $r->failed;
+        if (my $hold = $h->content) {
+            $multi_targeter->request( 'open-ils.storage.action.hold_request.copy_targeter', '', $hold->[0], $hold->[1]);
+        }
     }
 
+    $storage->disconnect();
+
     $multi_targeter->session_wait(1);
     $multi_targeter->disconnect;
 

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

Summary of changes:
 .../Application/Storage/Publisher/action.pm        |    2 +-
 Open-ILS/src/support-scripts/hold_targeter.pl      |   12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list