Hold shelf expire cstore keepalive
authorBill Erickson <berickxx@gmail.com>
Mon, 26 Mar 2018 17:24:44 +0000 (13:24 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index 9eb8267..4fbd48c 100644 (file)
@@ -1142,6 +1142,18 @@ sub set_hold_shelf_expire_time {
             $expire_time = $dt_parser->parse_datetime(clean_ISO8601($dateinfo->{end}));
         }
         $interval_counter++;
+
+        # KCLS
+        # IF we're in this loop too long, our cstore transaction can 
+        # time out.  Periodically tell cstore we're still here by
+        # fetching a tiny org unit object.  This is obviously a hack.
+        # TODO: speed up the logic of this function overall.
+        # NOTE: we are not using the faster stock version of this 
+        # function because we need every day within the shelf 
+        # expire interval to be an open day for the pickup lib.
+        if ($interval_counter % 10 == 0 && $editor) {
+            $editor->retrieve_actor_org_unit(1);
+        }
     }
 
     $expire_time->set(hour => '23', minute => '59', second => '59');