[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 0041f47ce1e467b76115912c8a0666be7f3f0cc1

Evergreen Git git at git.evergreen-ils.org
Thu Feb 9 16:51:48 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, rel_2_1 has been updated
       via  0041f47ce1e467b76115912c8a0666be7f3f0cc1 (commit)
      from  c3c37595218672b8b623ce8a38de4675b7807231 (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 0041f47ce1e467b76115912c8a0666be7f3f0cc1
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 a846fb9..cf9e03e 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
@@ -327,8 +327,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