LP#838296 Separate the auto lost trigger. collab/Callender/seperate_auto_lost_trigger
authorSteven Callender <stevecallender@esilibrary.com>
Wed, 31 Aug 2011 18:24:49 +0000 (18:24 +0000)
committerSteven Callender <stevecallender@esilibrary.com>
Wed, 31 Aug 2011 18:24:49 +0000 (18:24 +0000)
This patch will separate the auto lost trigger so it will run
on it's own schedule in cron, making use of a granularity
titles 'daily-lost'. This will help prevent the triggers from
failing just because of a heave load on the auto lost reactor.

Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Open-ILS/examples/crontab.example
Open-ILS/src/sql/Pg/upgrade/xxxx.data.seperate-auto-lost-trigger.sql [new file with mode: 0644]

index 1cd1db3..dda50a2 100644 (file)
@@ -67,10 +67,11 @@ EG_BIN_DIR = /openils/bin
 # Note: push these back to 3am so they will run after the fine generator and spread out the start minute to reduce dogpiling
 0 * * * *   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity hourly
 5 3 * * *   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity daily
-10 3 * * 1-5 . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity weekdays
-15 3 * * 0   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity weekly
-20 3 1 * *   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity monthly
-25 3 1 1 *   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity yearly
+10 3 * * *   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity daily-lost
+15 3 * * 1-5 . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity weekdays
+20 3 * * 0   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity weekly
+25 3 1 * *   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity monthly
+30 3 1 1 *   . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity yearly
 
 # Legacy overdue/predue notice generator.  Change to suit.
 #XML_FILE_PREFIX = /openils/var/data/overdue/overdue
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.seperate-auto-lost-trigger.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.seperate-auto-lost-trigger.sql
new file mode 100644 (file)
index 0000000..eab7098
--- /dev/null
@@ -0,0 +1,7 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('xxxx'); -- Callender
+
+UPDATE action_trigger.event_definition set granularity='daily-lost' where reactor='MarkItemLost' and granularity='daily';
+
+COMMIT;