Skip to content

Commit

Permalink
rename $trie to $try everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav Matyukhin committed Jul 18, 2012
1 parent 8bdc52a commit 3a417f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/DBD/Safe.pm
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ sub connect {
}

my $retry_cb = sub {
my $trie = shift;
if ($trie == 1) {
my $try = shift;
if ($try == 1) {
return 1;
} else {
return 0;
Expand Down Expand Up @@ -414,11 +414,11 @@ sub stay_connected {
#return $dbh->set_err($DBI::stderr, "Reconnect needed when db in transaction");
}

my $trie = 0;
my $try = 0;
my $retry_cb = $dbh->FETCH('x_safe_retry_cb');
while (1) {
$trie++;
my $can_connect = $retry_cb->($trie);
$try++;
my $can_connect = $retry_cb->($try);
if ($can_connect) {
my $dbh = eval { real_connect($dbh) };
if (!$dbh) {
Expand Down
2 changes: 1 addition & 1 deletion t/main.t
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ sub reconnect_threads : Test(1) {

sub retry_cb : Test(1) {
my $cb = sub {
my $trie = shift;
my $try = shift;
return 0
};
dies_ok(sub { get_dbh({retry_cb => $cb}) }, "always negative retry_cb");
Expand Down

0 comments on commit 3a417f8

Please sign in to comment.