diff --git a/bin/pt-table-sync b/bin/pt-table-sync index ee37cc26..e733447e 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -6111,9 +6111,10 @@ sub lock_and_wait { my $ms = $self->{MasterSlave}; my $tries = $args{wait_retry_args}->{tries} || 3; my $wait; + my $sleep = $args{wait_retry_args}->{wait} || 10; $self->{Retry}->retry( tries => $tries, - wait => sub { sleep $args{wait_retry_args}->{wait} || 10 }, + wait => sub { sleep($sleep) }, try => sub { my ( %args ) = @_; @@ -6144,7 +6145,7 @@ sub lock_and_wait { . "the slave is running."; } if ( $tries - $args{tryno} ) { - $msg .= " Sleeping $wait seconds then retrying " + $msg .= " Sleeping $sleep seconds then retrying " . ($tries - $args{tryno}) . " more times."; } warn "$msg\n"; diff --git a/lib/TableSyncer.pm b/lib/TableSyncer.pm index 3904c2ce..f096103e 100644 --- a/lib/TableSyncer.pm +++ b/lib/TableSyncer.pm @@ -513,9 +513,10 @@ sub lock_and_wait { my $ms = $self->{MasterSlave}; my $tries = $args{wait_retry_args}->{tries} || 3; my $wait; + my $sleep = $args{wait_retry_args}->{wait} || 10; $self->{Retry}->retry( tries => $tries, - wait => sub { sleep $args{wait_retry_args}->{wait} || 10 }, + wait => sub { sleep($sleep) }, try => sub { my ( %args ) = @_; # Be careful using $args{...} in this callback! %args in @@ -558,7 +559,7 @@ sub lock_and_wait { . "the slave is running."; } if ( $tries - $args{tryno} ) { - $msg .= " Sleeping $wait seconds then retrying " + $msg .= " Sleeping $sleep seconds then retrying " . ($tries - $args{tryno}) . " more times."; } warn "$msg\n";