X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=lib%2FSpeak.pm;h=7003f209803a5a186724907d9886e909e1ed534e;hb=b9581bfa0e37aafedf42ccbb1c514b572aa0d8d3;hp=c18c2f7feda4c2fc8e4d60ab5286b4d0641d4ec9;hpb=cc363d84e59a0beafb118bdc7b523fce374ba2b1;p=clearscm.git diff --git a/lib/Speak.pm b/lib/Speak.pm index c18c2f7..7003f20 100644 --- a/lib/Speak.pm +++ b/lib/Speak.pm @@ -103,11 +103,12 @@ Returns: =cut - if (-f "$FindBin::Bin/shh") { + if (-f "$FindBin::Bin/../data/shh") { + $msg .= ' [silent shh]'; if ($log) { - $log->msg("Not speaking because we were asked to be quiet - $msg"); + $log->msg($msg); } else { - verbose "Not speaking because we were asked to be quiet - $msg"; + verbose $msg; } # if return; @@ -123,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\""; @@ -139,9 +142,9 @@ Returns: error $errmsg; } # if - sleep $backoff++; + sleep int rand 10; } else { - return; # We said our piece... + return; } # if } # while