future hold request followup 3 - build_holdsqueue
authorGalen Charlton <gmcharlt@gmail.com>
Tue, 11 Aug 2009 23:20:48 +0000 (19:20 -0400)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 11 Aug 2009 23:23:40 +0000 (19:23 -0400)
Fixed the holds queue job so that it correctly
ignores hold requests that are not yet scheduled
to be filled.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
misc/cronjobs/holds/build_holds_queue.pl

index 4aca28d..4f9549f 100755 (executable)
@@ -83,7 +83,8 @@ sub GetBibsWithPendingHoldRequests {
     my $bib_query = "SELECT DISTINCT biblionumber
                      FROM reserves
                      WHERE found IS NULL
-                     AND priority > 0";
+                     AND priority > 0
+                     AND reservedate <= CURRENT_DATE()";
     my $sth = $dbh->prepare($bib_query);
 
     $sth->execute();
@@ -129,6 +130,7 @@ sub GetPendingHoldRequestsForBib {
                          WHERE biblionumber = ?
                          AND found IS NULL
                          AND priority > 0
+                         AND reservedate <= CURRENT_DATE()
                          ORDER BY priority";
     my $sth = $dbh->prepare($request_query);
     $sth->execute($biblionumber);