$zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr
$clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting
$allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart
- $can_encode $maxconnect_user $maxconnect_node $idle_interval
+ $can_encode $maxconnect_user $maxconnect_node $idle_interval $log_flush_interval
);
@inqueue = (); # the main input queue, an array of hashes
$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.
+$log_flush_interval = 2; # interval to wait between log flushes
+
our $ending; # signal that we are ending;
$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);
{
my $timenow = time;
- DXChannel::process();
+ BPQMsg::process();
+# DXChannel::process();
# $DB::trace = 0;
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::flushall();
}
- 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 {
#open(DB::OUT, "|tee /tmp/aa");
my $main_loop = Mojo::IOLoop->recurring($idle_interval => \&idle_loop);
+my $log_flush_loop = Mojo::IOLoop->recurring($log_flush_interval => \&DXLog::flushall);
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;