projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix DXUtil::localdata ?perl bug?
[spider.git]
/
perl
/
DXUser.pm
diff --git
a/perl/DXUser.pm
b/perl/DXUser.pm
index 60d49eafe72e3d7b7f613f068f75cc132f273324..26eb3d424000528561df17944f0c13b04e9acaf1 100644
(file)
--- a/
perl/DXUser.pm
+++ b/
perl/DXUser.pm
@@
-177,9
+177,9
@@
sub init
sub del_file
{
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"
;
}
#
}
#
@@
-412,10
+412,10
@@
sub fields
sub export
{
sub export
{
- my $name = shift;
+ my $name = shift
|| 'user_asc'
;
my $basic_info_only = shift;
my $basic_info_only = shift;
- my $fn =
"$main::local_data/$name";
+ my $fn =
$name ne 'user_asc' ? $name : "$main::local_data/$name"; # force use of local
# save old ones
move "$fn.oooo", "$fn.ooooo" if -e "$fn.oooo";
# save old ones
move "$fn.oooo", "$fn.ooooo" if -e "$fn.oooo";
@@
-466,8
+466,6
@@
BEGIN {
}
}
}
}
-package DXUser;
-
use SysVar;
use DXUser;
use SysVar;
use DXUser;
@@
-476,8
+474,10
@@
if (@ARGV) {
print "user filename now $userfn\n";
}
print "user filename now $userfn\n";
}
-DXUser::del_file();
-DXUser::init();
+package DXUser;
+
+del_file();
+init(1);
%u = ();
my $count = 0;
my $err = 0;
%u = ();
my $count = 0;
my $err = 0;
@@
-488,12
+488,13
@@
while (<DATA>) {
if ($ref) {
$ref->put();
$count++;
if ($ref) {
$ref->put();
$count++;
+ DXUser::sync() unless $count % 10000;
} else {
print "# Error: $f[0]\t$f[1]\n";
$err++
}
}
} 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";
print "There are $count user records and $err errors\n";
};
print $fh "__DATA__\n";
@@
-533,8
+534,10
@@
print "There are $count user records and $err errors\n";
}
}
$fh->close;
}
}
$fh->close;
- }
- return "$count Users $del Deleted $err Errors ('sh/log Export' for details)";
+ }
+ my $s = qq{Exported users to $fn - $count Users $del Deleted $err Errors ('sh/log Export' for details)};
+ LogDbg('command', $s);
+ return $s;
}
#
}
#