mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Hot-fix --version-check.
This commit is contained in:
@@ -4560,10 +4560,27 @@ sub update_check_times {
|
||||
my $vc_file = $args{vc_file} || version_check_file();
|
||||
PTDEBUG && _d('Updating last check time:', $now);
|
||||
|
||||
my %all_instances = map {
|
||||
$_->{id} => { name => $_->{name}, ts => $now }
|
||||
} @$instances;
|
||||
|
||||
if ( -f $vc_file ) {
|
||||
open my $fh, '<', $vc_file or die "Cannot read $vc_file: $OS_ERROR";
|
||||
my $contents = do { local $/ = undef; <$fh> };
|
||||
close $fh;
|
||||
|
||||
foreach my $line ( split("\n", ($contents || '')) ) {
|
||||
my ($id, $ts) = split(',', $line);
|
||||
if ( !exists $all_instances{$id} ) {
|
||||
$all_instances{$id} = { ts => $ts }; # original ts, not updated
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open my $fh, '>', $vc_file or die "Cannot write to $vc_file: $OS_ERROR";
|
||||
foreach my $instance ( sort { $a->{id} cmp $b->{id} } @$instances ) {
|
||||
PTDEBUG && _d('Updated:', Dumper($instance));
|
||||
print { $fh } $instance->{id} . ',' . $now . "\n";
|
||||
foreach my $id ( sort keys %all_instances ) {
|
||||
PTDEBUG && _d('Updated:', $id, Dumper($all_instances{$id}));
|
||||
print { $fh } $id . ',' . $all_instances{$id}->{ts} . "\n";
|
||||
}
|
||||
close $fh;
|
||||
|
||||
@@ -4598,7 +4615,7 @@ sub get_instance_id {
|
||||
}
|
||||
my $id = md5_hex($name);
|
||||
|
||||
PTDEBUG && _d('MySQL instance:', $id, $name, $dsn);
|
||||
PTDEBUG && _d('MySQL instance:', $id, $name, Dumper($dsn));
|
||||
|
||||
return $name, $id;
|
||||
}
|
||||
|
Reference in New Issue
Block a user