-- AutoRenewer A/T Def:
INSERT INTO action_trigger.event_definition(active, owner, name, hook, validator, reactor, delay, max_delay, delay_field, group_field)
- values (false, 1, 'Autorenew', 'checkout.due', 'CircIsOpen', 'Circ::AutoRenew', '-23 hours'::interval,'-1 minute'::interval, 'due_date', 'usr');
+ values (false, 1, 'Autorenew', 'checkout.due', 'CircIsOpen', 'Circ::AutoRenew', '-24:01:00'::interval,'-1 minute'::interval, 'due_date', 'usr');
-- AutoRenewal outcome Email notifier A/T Def:
INSERT INTO action_trigger.event_definition(active, owner, name, hook, validator, reactor, group_field, template)
--- /dev/null
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+UPDATE action_trigger.event_definition
+SET delay = '-24:01:00'::INTERVAL
+WHERE reactor = 'Circ::AutoRenew'
+AND delay = '-23 hours'::INTERVAL
+AND max_delay = '-1 minute'::INTERVAL;
+
+
+COMMIT;
--- /dev/null
+Change in AutoRenew Event Definition Default Delay
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The delay for the AutoRenew event has been changed from -23 hours to
+-24 hours and 1 minute. The previous values of -23 hours for the
+delay and -1 minute for the max_delay left a gap of approximately 1
+hour where items would not auto-renew if they fell due during that
+time. Depending upon the time that the AutoRenew event runner is
+scheduled to run, this gap may never turn up. However, all it takes
+is a misconfigured client (i.e. an incorrect timezone setting) or a
+manually edited due date on a circulation for this to turn up. The
+new interval settings guarantee that all circulations for a given 24
+hour period are selected with no gap.
+
+A database upgrade script is provided to alter any event definitions
+using the Circ::Autorenew reactor and the previous default delay
+values to the new settings. If you have customized or added any event
+definitions using this reactor, you should double check that they are
+correct after an upgrade.