sub process
{
- foreach my $dxchan (get_all()) {
+ foreach my $dxchan (values %channels) {
while (my $data = shift @{$dxchan->{inqueue}}) {
my ($sort, $call, $line) = $dxchan->decode_input($data);
if ($v4) {
my $new = ! -e $ufn;
$dbh = DBI->connect("dbi:SQLite:dbname=$ufn","","") or die "Cannot open $ufn ($!)\n";
- if ($new && $dbh) {
+ if ($new) {
# create the table
my $table = q{create table user(
call text not null unique,
# Add indexes
$dbh->do(q(create index x1 on user(lastseen))) or die $dbh->errstr;
}
+ $dbh->do(q{PRAGMA cache_size = 8000});
+ $dbh->do(q{PRAGMA synchronous = OFF});
}
my ($pkg, $my_host, $my_port, $login_proc) = @_;
my $self = $pkg->new($login_proc);
- $self->{sock} = tcp_server $my_host, $my_port, sub { $self->new_client(@_); }, sub { return 256; };
+ $self->{sock} = tcp_server $my_host, $my_port, sub { $self->new_client(@_); };
die "Could not create socket: $! \n" unless $self->{sock};
return $self;
}
$version = '1.56';
$subversion = '0';
-$build = '15';
-$gitversion = '955a8e0';
+$build = '16';
+$gitversion = 'fb8e4bc';
1;
$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
+ $can_encode $maxconnect_user $maxconnect_node $idle_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.
# send a message to call on conn and disconnect
sub already_conn
}
LogDbg('cluster', "DXSpider V$version, build $subversion.$build (git: $gitversion) ended");
+ dbg("bye bye everyone - bye bye");
+
dbgclose();
Logclose();
#open(DB::OUT, "|tee /tmp/aa");
-my $per_sec = AnyEvent->timer(after => 0, interval => 0.010, cb => sub{idle_loop()});
+my $per_sec = AnyEvent->timer(after => 0, interval => $idle_interval, cb => sub{idle_loop()});
# main loop
$decease->recv;
-#AnyEvent->loop;
idle_loop() for (1..25);
cease(0);