Fix (now) missing dxchan error_handler
[spider.git] / perl / cluster.pl
index f100d4078f3b1440686a754aa512aee04bd18ff0..ab6673247fcf04c899d1756eb24766493fce7641 100755 (executable)
@@ -138,7 +138,7 @@ $maxconnect_user = 3;                       # the maximum no of concurrent connections a user can ha
 $maxconnect_node = 0;                  # Ditto but for nodes. In either case if a new incoming connection
                                                                # takes the no of references in the routing table above these numbers
                                                                # then the connection is refused. This only affects INCOMING connections.
-$idle_interval = 0.100;                        # the wait between invocations of the main idle loop processing.
+$idle_interval = 0.500;                        # the wait between invocations of the main idle loop processing.
 our $ending;                                                              # signal that we are ending;
 
 
@@ -237,7 +237,7 @@ sub new_channel
        $conn->conns($call) if $conn->isa('IntMsg');
 
        # set callbacks
-       $conn->set_error(sub {my $err = shift; error_handler($dxchan, $err)});
+       $conn->set_error(sub {my $err = shift; LogDbg('DXCommand', "Comms error '$err' received for call $dxchan->{call}"); $dxchan->disconnect(1);});
        $conn->set_on_eof(sub {$dxchan->disconnect});
        $conn->set_rproc(sub {my ($conn,$msg) = @_; $dxchan->rec($msg);});
        $dxchan->rec($msg);
@@ -341,7 +341,8 @@ sub idle_loop
 {
        my $timenow = time;
 
-       DXChannel::process();
+       BPQMsg::process();
+#      DXChannel::process();
 
        #      $DB::trace = 0;
 
@@ -364,23 +365,16 @@ sub idle_loop
                DXDb::process();
                DXUser::process();
                DXDupe::process();
-               $systime_days = $days;
-               $systime_daystart = $days * 86400;
+               DXCron::process();                      # do cron jobs
+               IsoTime::update($systime);
+               DXProt::process();                      # process ongoing ak1a pcxx stuff
+               DXConnect::process();
+               DXUser::process();
+               AGWMsg::process();
+               
+               Timer::handler();
+               DXLog::flush_all();
        }
-       IsoTime::update($systime);
-       DXCron::process();                      # do cron jobs
-       DXCommandmode::process();       # process ongoing command mode stuff
-       DXXml::process();
-       DXProt::process();                      # process ongoing ak1a pcxx stuff
-       DXConnect::process();
-       DXMsg::process();
-       DXDb::process();
-       DXUser::process();
-       DXDupe::process();
-       AGWMsg::process();
-       BPQMsg::process();
-
-       Timer::handler();
 
        if (defined &Local::process) {
                eval {