[open-ils-commits] r14710 - tags/rel_1_6_0_0/Open-ILS/src/support-scripts (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Nov 1 20:49:07 EST 2009


Author: erickson
Date: 2009-11-01 20:49:06 -0500 (Sun, 01 Nov 2009)
New Revision: 14710

Modified:
   tags/rel_1_6_0_0/Open-ILS/src/support-scripts/action_trigger_runner.pl
Log:
added explicit --process-hooks flag to turn on hook event creation.  This allows the script to run in --run-pending mode without trying to create hook events from default values

Modified: tags/rel_1_6_0_0/Open-ILS/src/support-scripts/action_trigger_runner.pl
===================================================================
--- tags/rel_1_6_0_0/Open-ILS/src/support-scripts/action_trigger_runner.pl	2009-11-02 01:48:54 UTC (rev 14709)
+++ tags/rel_1_6_0_0/Open-ILS/src/support-scripts/action_trigger_runner.pl	2009-11-02 01:49:06 UTC (rev 14710)
@@ -28,11 +28,13 @@
 my $opt_debug_stdout = 0;
 my $opt_help = 0;
 my $opt_hooks;
+my $opt_process_hooks = 0;
 
 GetOptions(
     'osrf-config=s' => \$opt_osrf_config,
     'run-pending' => \$opt_run_pending,
     'hooks=s' => \$opt_hooks,
+    'process-hooks' => \$opt_process_hooks,
     'debug-stdout' => \$opt_debug_stdout,
     'custom-filters=s' => \$opt_custom_filter,
     'lock-file=s' => \$opt_lockfile,
@@ -77,11 +79,14 @@
             /openils/conf/action_trigger_filters.json
 
     --run-pending
-        Run pending action_trigger.event's
+        Run pending events
 
+    --process-hooks
+        Create hook events
+
     --hooks=hook1[,hook2,hook3,...]
-        Hooks for which events should be generated.  Defaults to the list of
-        hooks defined in the --custom-filters option.
+        Define which hooks to create events for.  If none are defined,
+        it defaults to the list of hooks defined in the --custom-filters option.
 
     --debug-stdout
         Print server responses to stdout (as JSON) for debugging
@@ -107,6 +112,7 @@
 
 # create events for the specified hooks using the configured filters and context orgs
 sub process_hooks {
+    return unless $opt_process_hooks;
 
     my @hooks = ($opt_hooks) ? split(',', $opt_hooks) : keys(%$hook_handlers);
     my $ses = OpenSRF::AppSession->create('open-ils.trigger');



More information about the open-ils-commits mailing list