From: minima Date: Sat, 29 Jul 2000 16:18:19 +0000 (+0000) Subject: 2. speeded up the show/node command by using the DB_File interface and X-Git-Tag: R_1_43~20 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=32849fc856cb0cb825657c0013dfefb125a96bab;p=spider.git 2. speeded up the show/node command by using the DB_File interface and sequentially reading the data directly and only 'get'ting the ones that are nodes. 3. did the same for show/isolate and show/lockout. --- diff --git a/Changes b/Changes index 03561b0c..d35eb5a5 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,10 @@ 1. added forward/latlong which will forward ALL the users that have a latitude and longitude set on them to one or more locally connected nodes - with a hop count of 1. +2. speeded up the show/node command by using the DB_File interface and +sequentially reading the data directly and only 'get'ting the ones that are +nodes. +3. did the same for show/isolate and show/lockout. 28Jul00======================================================================= 1. fixed watchdbg midnight rollover loop and removed the date part of the date/time translation to leave just the time. diff --git a/cmd/forward/latlong.pl b/cmd/forward/latlong.pl index 15712f00..7f6472bd 100644 --- a/cmd/forward/latlong.pl +++ b/cmd/forward/latlong.pl @@ -1,5 +1,5 @@ # -# merge_qra +# forward/latlong ... # # send out PC41s toward a node for every user that has a lat/long # @@ -46,4 +46,4 @@ for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $a } } } -return(1, @out, "$count records sent"); +return(1, @out, $self->msg('rec', $count)); diff --git a/cmd/show/isolate.pl b/cmd/show/isolate.pl index bea994fa..c874e8a8 100644 --- a/cmd/show/isolate.pl +++ b/cmd/show/isolate.pl @@ -11,6 +11,21 @@ my ($self, $line) = @_; return (1, $self->msg('e5')) unless $self->priv >= 1; -# search thru the user for nodes -my @out = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->isolate) ? $_ : () } DXUser::get_all_calls; -return (1, @out); +my @out; + +use DB_File; + +my ($action, $count, $key, $data); +for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) { + if ($data =~ m{isolate =>}) { + my $u = DXUser->get_current($key); + if ($u && $u->isolate) { + push @out, $key; + ++$count; + } + } +} + +return (1, @out, $self->msg('rec', $count)); + + diff --git a/cmd/show/lockout.pl b/cmd/show/lockout.pl index 6b7b7d49..8c9c488c 100644 --- a/cmd/show/lockout.pl +++ b/cmd/show/lockout.pl @@ -11,7 +11,21 @@ my ($self, $line) = @_; return (1, $self->msg('e5')) unless $self->priv >= 9; -# search thru the user for nodes -my @out = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->lockout) ? $_ : () } DXUser::get_all_calls; -return (1, @out); +my @out; + +use DB_File; + +my ($action, $count, $key, $data); +for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) { + if ($data =~ m{lockout =>}) { + my $u = DXUser->get_current($key); + if ($u && $u->lockout) { + push @out, $key; + ++$count; + } + } +} + +return (1, @out, $self->msg('rec', $count)); + diff --git a/cmd/show/node.pl b/cmd/show/node.pl index c18d8fb9..9bc77e2a 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -22,8 +22,6 @@ my @out; # search thru the user for nodes unless (@call) { -# the official way -# @call = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->sort ne 'U') ? $_ : () } DXUser::get_all_calls; use DB_File; my ($action, $count, $key, $data); @@ -71,7 +69,7 @@ foreach $call (@call) { } } -return (1, @out); +return (1, @out, $self->msg('rec', $count)); diff --git a/perl/Messages b/perl/Messages index c2dae16c..56fcb345 100644 --- a/perl/Messages +++ b/perl/Messages @@ -159,6 +159,7 @@ package DXM; qrae2 => 'Don\'t recognise \"$_[0]\" as a QRA locator (eg JO02LQ)', qra => 'Your QRA Locator is now \"$_[0]\"', rcmdo => 'RCMD \"$_[0]\" sent to $_[1]', + rec => '$_[0] records', read1 => 'Sorry, no new messages for you', read2 => 'Msg $_[0] not found', read3 => 'Msg $_[0] not available',