[open-ils-commits] r16514 - trunk/Open-ILS/src/support-scripts (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed May 26 17:30:00 EDT 2010
Author: senator
Date: 2010-05-26 17:29:54 -0400 (Wed, 26 May 2010)
New Revision: 16514
Modified:
trunk/Open-ILS/src/support-scripts/action_trigger_runner.pl
Log:
Minor whitespace/syntax changes, sifted out of the previous telephony commit.
Modified: trunk/Open-ILS/src/support-scripts/action_trigger_runner.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/action_trigger_runner.pl 2010-05-26 21:26:55 UTC (rev 16513)
+++ trunk/Open-ILS/src/support-scripts/action_trigger_runner.pl 2010-05-26 21:29:54 UTC (rev 16514)
@@ -71,12 +71,9 @@
};
if ($opt_custom_filter) {
- if (open FILTERS, $opt_custom_filter) {
- $hook_handlers = OpenSRF::Utils::JSON->JSON2perl(join('',(<FILTERS>)));
- 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('',(<FILTERS>)));
+ close FILTERS;
}
sub help {
@@ -149,10 +146,8 @@
$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 @@
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 = <LF>;
@@ -173,9 +168,7 @@
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";
}
}
More information about the open-ils-commits
mailing list