Adding a WHERE clause to prevent timeout of juv-to-adult function
authorChris Sharp <csharp@georgialibraries.org>
Thu, 11 Oct 2012 23:33:16 +0000 (19:33 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 12 Oct 2012 19:36:06 +0000 (15:36 -0400)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/actor.pm

index d41dfcc..8fa6c44 100644 (file)
@@ -32,7 +32,8 @@ sub juv_to_adult {
        my $sql = <<"   SQL";
             UPDATE  actor.usr
               SET   juvenile = FALSE
-              WHERE AGE(dob) > ?::INTERVAL;
+              WHERE AGE(dob) > ?::INTERVAL
+             AND juvenile IS TRUE;
        SQL
 
     my $sth = actor::user->db_Main->prepare_cached($sql);