From: erickson Date: Fri, 16 Jul 2010 13:57:15 +0000 (+0000) Subject: rearrange while loop to prevent error: Can't 'last' outside a loop block X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=20c7632057b548a8fec5a3c824ae9f8ac63ebf01;p=contrib%2FConifer.git rearrange while loop to prevent error: Can't 'last' outside a loop block git-svn-id: svn://svn.open-ils.org/ILS/trunk@16956 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/support-scripts/action_trigger_runner.pl b/Open-ILS/src/support-scripts/action_trigger_runner.pl index 79af2fb8cd..8013e576b6 100755 --- a/Open-ILS/src/support-scripts/action_trigger_runner.pl +++ b/Open-ILS/src/support-scripts/action_trigger_runner.pl @@ -194,7 +194,10 @@ help() and exit unless ($opt_run_pending or $opt_process_hooks); if (-e $opt_lockfile) { die "I'm already running with lockfile $opt_lockfile\n" if (!$opt_process_hooks); # sleeping loop if we're in --process-hooks mode - do { last unless ( -e $opt_lockfile ); $max_sleep--; } while ($max_sleep >= 0 && sleep(1)); + while ($max_sleep >= 0 && sleep(1)) { + last unless ( -e $opt_lockfile ); + $max_sleep--; + } } # there's a tiny race condition here ... oh well