X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=lib%2FSpeak.pm;h=7003f209803a5a186724907d9886e909e1ed534e;hb=38d55f066c8a0b870321c6a375ae1d78607dded5;hp=d46249075db8f77950fdf171ba1410040b809adc;hpb=f3e0cdceb40c69dc13b1edf6d9d2af3bd38798c1;p=clearscm.git diff --git a/lib/Speak.pm b/lib/Speak.pm index d462490..7003f20 100644 --- a/lib/Speak.pm +++ b/lib/Speak.pm @@ -103,8 +103,8 @@ Returns: =cut - if (-f "$FindBin::Bin/shh") { - $msg .= ' [silent]'; + if (-f "$FindBin::Bin/../data/shh") { + $msg .= ' [silent shh]'; if ($log) { $log->msg($msg); } else { @@ -124,10 +124,12 @@ Returns: # backoff a little and try again. my $attempts = 0; my $maxretries = 3; - my $backoff = 2; my ($status, @output); + # Log message to log file if $log was passed in. + $log->msg($msg) if $log; + while ($attempts++ < $maxretries) { ($status, @output) = Execute "/usr/local/bin/gt \"$msg\""; @@ -140,9 +142,9 @@ Returns: error $errmsg; } # if - sleep $backoff++; + sleep int rand 10; } else { - return; # We said our piece... + return; } # if } # while