From: minima Date: Sun, 28 Jul 2002 17:49:27 +0000 (+0000) Subject: add eval blocks around the ivalid key deletes in export_user X-Git-Tag: R_1_50~13 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=8493b0e275d75c6ef3dc4878cd3f1d9ff554976d;p=spider.git add eval blocks around the ivalid key deletes in export_user --- diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 84a56949..294a76c0 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -400,8 +400,9 @@ print "There are $count user records and $err errors\n"; for ($action = R_FIRST; !$dbm->seq($key, $val, $action); $action = R_NEXT) { if (!is_callsign($key) || $key =~ /^0/) { - Log('DXCommand', "Export Error: $key\t$val"); - $dbm->del($key); + Log('DXCommand', "Export Error1: $key\t$val"); + eval {$dbm->del($key)}; + dbg(carp("Export Error1: $key\t$val\n$@")) if $@; ++$err; next; } @@ -410,8 +411,9 @@ print "There are $count user records and $err errors\n"; print $fh "$key\t" . $ref->encode . "\n"; ++$count; } else { - Log('DXCommand', "Export Error: $key\t$val"); - $dbm->del($key); + Log('DXCommand', "Export Error2: $key\t$val"); + eval {$dbm->del($key)}; + dbg(carp("Export Error2: $key\t$val\n$@")) if $@; ++$err; } } diff --git a/perl/Msg.pm b/perl/Msg.pm index ec2f3b4c..834d2087 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -585,24 +585,35 @@ sub set_event_handler { } sub event_loop { - my ($pkg, $loop_count, $timeout) = @_; # event_loop(1) to process events once + my ($pkg, $loop_count, $timeout, $wronly) = @_; # event_loop(1) to process events once my ($conn, $r, $w, $e, $rset, $wset, $eset); while (1) { # Quit the loop if no handles left to process - last unless ($rd_handles->count() || $wt_handles->count()); + if ($wronly) { + last unless $wt_handles->count(); - ($rset, $wset, $eset) = IO::Select->select($rd_handles, $wt_handles, $er_handles, $timeout); - - foreach $e (@$eset) { - &{$er_callbacks{$e}}($e) if exists $er_callbacks{$e}; - } - foreach $r (@$rset) { - &{$rd_callbacks{$r}}($r) if exists $rd_callbacks{$r}; - } - foreach $w (@$wset) { - &{$wt_callbacks{$w}}($w) if exists $wt_callbacks{$w}; - } + ($rset, $wset, $eset) = IO::Select->select(undef, $wt_handles, undef, $timeout); + + foreach $w (@$wset) { + &{$wt_callbacks{$w}}($w) if exists $wt_callbacks{$w}; + } + } else { + + last unless ($rd_handles->count() || $wt_handles->count()); + + ($rset, $wset, $eset) = IO::Select->select($rd_handles, $wt_handles, $er_handles, $timeout); + + foreach $e (@$eset) { + &{$er_callbacks{$e}}($e) if exists $er_callbacks{$e}; + } + foreach $r (@$rset) { + &{$rd_callbacks{$r}}($r) if exists $rd_callbacks{$r}; + } + foreach $w (@$wset) { + &{$wt_callbacks{$w}}($w) if exists $wt_callbacks{$w}; + } + } Timer::handler;