]> dxcluster.org Git - spider.git/commitdiff
add eval blocks around the ivalid key deletes in export_user
authorminima <minima>
Sun, 28 Jul 2002 17:49:27 +0000 (17:49 +0000)
committerminima <minima>
Sun, 28 Jul 2002 17:49:27 +0000 (17:49 +0000)
perl/DXUser.pm
perl/Msg.pm

index 84a569497171c9a0cc1584333130e59e8cc321ed..294a76c07774290b19bbea1a4141d6479bd0ee78 100644 (file)
@@ -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;
                        }
                } 
index ec2f3b4ca0214836327bb99c8a84aaa60a609b6a..834d2087e7bf71bae6132695146a9fc30ff53d92 100644 (file)
@@ -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;