Actually make sure that DXUser::del_file removes all versions
of users.v3 it can find whether in /spider/data and in /spider/local_data.
In the process make sure that the DEFAULT place that "localdata(<file>)
places that <file> is in /spider/local_data.
sub del_file
{
- my $fn = localdata("users");
- $fn .= $v3 ? ".v3" : ".v2";
- unlink $fn;
+ # with extreme prejudice
+ unlink "$main::data/users.v3";
+ unlink "$main::local_data/users.v3";
}
#
if ($ref) {
$ref->put();
$count++;
+ DXUser::sync() unless $count % 10000;
} else {
print "# Error: $f[0]\t$f[1]\n";
$err++
}
}
-DXUser::sync; DXUser::finish;
+DXUser::sync(); DXUser::finish();
print "There are $count user records and $err errors\n";
};
print $fh "__DATA__\n";
sub localdata
{
my $ifn = shift;
- my $ofn = "$main::data/$ifn";
+ my $ofn = "$main::local_data/$ifn";
my $tfn;
if (-e "$main::local_data") {
- $tfn = "$main::local_data/$ifn";
+ $tfn = "$main::data/$ifn";
if (-e $tfn && -e $ofn) {
- $ofn = $tfn if -M $tfn < -M $ofn;
- } elsif (-e $tfn) {
- $ofn = $tfn;
- }
+ $ofn = $tfn if -M $ofn < -M $tfn;
+ }
}
return $ofn;