From 6b69676866b127317425a587074928ca29446d98 Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 26 May 2010 21:29:54 +0000 Subject: [PATCH] Minor whitespace/syntax changes, sifted out of the previous telephony commit. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16514 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/support-scripts/action_trigger_runner.pl | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Open-ILS/src/support-scripts/action_trigger_runner.pl b/Open-ILS/src/support-scripts/action_trigger_runner.pl index 26bdc80da..909d8dc1b 100755 --- a/Open-ILS/src/support-scripts/action_trigger_runner.pl +++ b/Open-ILS/src/support-scripts/action_trigger_runner.pl @@ -71,12 +71,9 @@ my $hook_handlers = { }; if ($opt_custom_filter) { - if (open FILTERS, $opt_custom_filter) { - $hook_handlers = OpenSRF::Utils::JSON->JSON2perl(join('',())); - close FILTERS; - } else { - die "Cannot read filter file '$opt_custom_filter'"; - } + open FILTERS, $opt_custom_filter or die "Cannot read custom filters at $opt_custom_filter"; + $hook_handlers = OpenSRF::Utils::JSON->JSON2perl(join('',())); + close FILTERS; } sub help { @@ -149,10 +146,8 @@ sub process_hooks { $method =~ s/passive/active/ if $config->{active}; my $req = $ses->request($method, $hook, $config->{context_org}, $config->{filter}, $opt_granularity); - while(my $resp = $req->recv(timeout => 1800)) { - if($opt_debug_stdout) { - print OpenSRF::Utils::JSON->perl2JSON($resp->content) . "\n"; - } + while (my $resp = $req->recv(timeout => 1800)) { + $opt_debug_stdout and print OpenSRF::Utils::JSON->perl2JSON($resp->content) . "\n"; } } } @@ -165,7 +160,7 @@ sub run_pending { my $req = $ses->request('open-ils.trigger.event.run_all_pending' => $opt_granularity); my $check_lockfile = 1; - while(my $resp = $req->recv(timeout => 7200)) { + while (my $resp = $req->recv(timeout => 7200)) { if ($check_lockfile && -e $opt_lockfile) { open LF, $opt_lockfile; my $contents = ; @@ -173,9 +168,7 @@ sub run_pending { unlink $opt_lockfile if ($contents == $$); $check_lockfile = 0; } - if($opt_debug_stdout) { - print OpenSRF::Utils::JSON->perl2JSON($resp->content) . "\n"; - } + $opt_debug_stdout and print OpenSRF::Utils::JSON->perl2JSON($resp->content) . "\n"; } } -- 2.11.0