tpac ac part 4 tpac-added-content
authorBill Erickson <berick@esilibrary.com>
Mon, 14 May 2012 21:18:58 +0000 (17:18 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 14 May 2012 21:18:58 +0000 (17:18 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm

index ac9d5fc..f7d09f6 100644 (file)
@@ -463,7 +463,11 @@ sub added_content_stage2 {
             my $req = $content->{request};
             my $sel = IO::Select->new($req);
 
-            if ($sel->can_read(0)) {
+            # if we are requesting a specific type of content, give the 
+            # backend code a little extra time to retrieve the content.
+            my $wait = $type eq $sel_type ? 3 : 0; # TODO: config?
+
+            if ($sel->can_read($wait)) {
                 my ($code) = $req->read_response_headers;
                 $content->{status} = $code eq '200' ? 1 : 2;
                 $logger->debug("tpac: added content request for $type returned $code");