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=7467e26d4957a1d991fcc02e8c76303bb85bc28d;hp=ab2cef27f9e543aebc20ae8c0bb919090ef14a96;hb=a9e8ba6d3e01d894bc6582f4caa69a97b573271a;hpb=0efdae771415f6d2aca5a9a30d8c5364da01299e diff --git a/lib/ZOOM/IRSpy/Test/Search/Explain.pm b/lib/ZOOM/IRSpy/Test/Search/Explain.pm index ab2cef2..7467e26 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.4 2007-02-23 15:03:44 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,8 +50,14 @@ 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); + zoom_error_timeout_update($conn, $exception); + + return ZOOM::IRSpy::Status::TEST_OK + if ($exception->code() == 109 || # Database unavailable + $exception->code() == 235); # Database does not exist return ZOOM::IRSpy::Status::TASK_DONE; }