don't fork sh/dx on simple query
authorDirk Koopman <djk@tobit.co.uk>
Mon, 15 Nov 2021 10:20:20 +0000 (10:20 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 15 Nov 2021 10:20:20 +0000 (10:20 +0000)
If the query does not contain an "expression" (or even just a
callsign and is garanteed to be satified by the cache - if it is
enabled - then do not fork / run as a sub command.

So 'sh/dx', 'sh/mydx' with or without a count will be run from
the cache - if it is enabled.

cmd/show/dx.pl

index 7e4d3a3587e8d7c655820f5c560dd1d5979130d3..bad8ffde0894634b51009a74a63ad903e23e7e17 100644 (file)
@@ -162,7 +162,7 @@ sub handle
   
        # now do the search
 
-       if ($self->{_nospawn}) {
+       if ($self->{_nospawn} || ($Spot::spotcachedays && !$expr && $from == 0 && $fromday == 0 && $today == 0)) {
                my @res = Spot::search($expr, $fromday, $today, $from, $to, $user, $dofilter, $self);
                my $ref;
                my @dx;