X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest%2FSearch%2FExplain.pm;h=7bdad0943ec9fef71be4161f4aac0f4509deee31;hp=fb3433b001c4f0377e3e6a3f3293a729c44ccf2d;hb=e61887a109576fa0e066547c0ce033631a290f8f;hpb=c84b7d4098ab03515227c044b2e8e472b42d968d diff --git a/lib/ZOOM/IRSpy/Test/Search/Explain.pm b/lib/ZOOM/IRSpy/Test/Search/Explain.pm index fb3433b..7bdad09 100644 --- a/lib/ZOOM/IRSpy/Test/Search/Explain.pm +++ b/lib/ZOOM/IRSpy/Test/Search/Explain.pm @@ -1,4 +1,3 @@ -# $Id: Explain.pm,v 1.5 2007-02-26 18:48:50 mike Exp $ # See the "Main" test package for documentation @@ -34,14 +33,12 @@ sub start { sub found { my($conn, $task, $test_args, $event) = @_; my $category = $test_args->{'category'}; - my $n = $task->{rs}->size(); - my $ok = 0; + my $n = $task->{rs}->size(); + $task->{rs}->destroy(); + my $ok = ($n > 0); $conn->log("irspy_test", "Explain category ", $category, " gave ", $n, " hit(s)."); - if ($n > 0) { - $ok = 1; - } update($conn, $category, $ok); @@ -53,11 +50,13 @@ sub error { my($conn, $task, $test_args, $exception) = @_; my $category = $test_args->{'category'}; + $task->{rs}->destroy(); $conn->log("irspy_test", "Explain category lookup failed: ", $exception); update($conn, $category, 0); return ZOOM::IRSpy::Status::TEST_BAD - if $exception->code() == 109; # Database unavailable + if ($exception->code() == 109 || # Database unavailable + $exception->code() == 235); # Database does not exist return ZOOM::IRSpy::Status::TASK_DONE; }