From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 28 May 2010 19:37:32 +0000 (+0000)
Subject: added a wait flag to create_events_for_hook() to allow for processing large sets... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4d578aa51accef3905b968da96251cde1b37d664;p=contrib%2FConifer.git

added a wait flag to create_events_for_hook() to allow for processing large sets of objects without dropping all the calls on the network at once

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16532 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
index d9165f8f3b..a2a954223a 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
@@ -1667,9 +1667,12 @@ sub fire_object_event {
 
 
 sub create_events_for_hook {
-    my($self, $hook, $obj, $org_id) = @_;
+    my($self, $hook, $obj, $org_id, $wait) = @_;
     my $ses = OpenSRF::AppSession->create('open-ils.trigger');
-    $ses->request('open-ils.trigger.event.autocreate', $hook, $obj, $org_id);
+    my $req = $ses->request('open-ils.trigger.event.autocreate', $hook, $obj, $org_id);
+    return undef unless $wait;
+    my $resp = $req->recv;
+    return $resp->content if $resp;
 }
 
 sub create_uuid_string {