projects
/
irspy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
@syntax made global.
[irspy-moved-to-github.git]
/
lib
/
ZOOM
/
IRSpy
/
Test
/
Search
/
Explain.pm
diff --git
a/lib/ZOOM/IRSpy/Test/Search/Explain.pm
b/lib/ZOOM/IRSpy/Test/Search/Explain.pm
index
a369262
..
087b846
100644
(file)
--- 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.3 2006-10-26 12:55:35 mike Exp $
# See the "Main" test package for documentation
# See the "Main" test package for documentation
@@
-25,7
+24,7
@@
sub start {
$conn->irspy_search_pqf('@attr exp-1 1=1 ' . $category,
{'category' => $category},
{ databaseName => 'IR-Explain-1' },
$conn->irspy_search_pqf('@attr exp-1 1=1 ' . $category,
{'category' => $category},
{ databaseName => 'IR-Explain-1' },
- ZOOM::Event::RECV_SEARCH, \&found,
+ ZOOM::Event::ZEND, \&found,
exception => \&error);
}
}
exception => \&error);
}
}
@@
-34,14
+33,12
@@
sub start {
sub found {
my($conn, $task, $test_args, $event) = @_;
my $category = $test_args->{'category'};
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).");
$conn->log("irspy_test", "Explain category ", $category, " gave ", $n,
" hit(s).");
- if ($n > 0) {
- $ok = 1;
- }
update($conn, $category, $ok);
update($conn, $category, $ok);
@@
-53,8
+50,14
@@
sub error {
my($conn, $task, $test_args, $exception) = @_;
my $category = $test_args->{'category'};
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);
$conn->log("irspy_test", "Explain category lookup failed: ", $exception);
update($conn, $category, 0);
+ zoom_error_timeout_update($conn, $exception);
+
+ return ZOOM::IRSpy::Status::TEST_BAD
+ if ($exception->code() == 109 || # Database unavailable
+ $exception->code() == 235); # Database does not exist
return ZOOM::IRSpy::Status::TASK_DONE;
}
return ZOOM::IRSpy::Status::TASK_DONE;
}