projects
/
irspy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5528534
)
Better reporting.
author
Mike Taylor
<mike@miketaylor.org.uk>
Tue, 8 Jun 2010 11:57:42 +0000
(12:57 +0100)
committer
Mike Taylor
<mike@miketaylor.org.uk>
Tue, 8 Jun 2010 11:57:42 +0000
(12:57 +0100)
lib/ZOOM/IRSpy/Test/Search/Bath.pm
patch
|
blob
|
history
diff --git
a/lib/ZOOM/IRSpy/Test/Search/Bath.pm
b/lib/ZOOM/IRSpy/Test/Search/Bath.pm
index
ad2321a
..
d00596c
100644
(file)
--- a/
lib/ZOOM/IRSpy/Test/Search/Bath.pm
+++ b/
lib/ZOOM/IRSpy/Test/Search/Bath.pm
@@
-42,14
+42,15
@@
sub start_search {
my $query = "\@attr 1=$use_attr \@attr 2=3 \@attr 3=3 \@attr 4=2 \@attr 5=100 \@attr 6=1 the";
$conn->irspy_search_pqf($query, { qindex => $qindex }, {},
my $query = "\@attr 1=$use_attr \@attr 2=3 \@attr 3=3 \@attr 4=2 \@attr 5=100 \@attr 6=1 the";
$conn->irspy_search_pqf($query, { qindex => $qindex }, {},
- ZOOM::Event::ZEND, \&found,
- "exception", \&error);
+ ZOOM::Event::ZEND, \&search_complete,
+ "exception", \&search_complete);
return ZOOM::IRSpy::Status::TASK_DONE;
}
return ZOOM::IRSpy::Status::TASK_DONE;
}
-sub found {
+sub search_complete {
my($conn, $task, $udata, $event) = @_;
my($conn, $task, $udata, $event) = @_;
+ my $ok = ref $event && $event->isa("ZOOM::Exception") ? 0 : 1;
my $qindex = $udata->{qindex};
my $ref = $bath_queries[$qindex];
my $qindex = $udata->{qindex};
my $ref = $bath_queries[$qindex];
@@
-57,28
+58,17
@@
sub found {
my $n = $task->{rs}->size();
my $n = $task->{rs}->size();
- $conn->log("irspy_test",
- "bath search #$qindex ('$name') found $n record",
- $n==1 ? "" : "s");
+ $conn->log("irspy_test", "bath search #$qindex ('$name') ",
+ $ok ? ("found $n record", $n==1 ? "" : "s") :
+ "had error: $event");
+
my $rec = $conn->record();
$rec->append_entry("irspy:status",
my $rec = $conn->record();
$rec->append_entry("irspy:status",
- "<irspy:search_bath name='$name' ok='1'>" .
+ "<irspy:search_bath name='$name' ok='$ok'>" .
isodate(time()) . "</irspy:search_bath>");
return start_search($conn, $qindex+1);
}
isodate(time()) . "</irspy:search_bath>");
return start_search($conn, $qindex+1);
}
-sub error {
- my($conn, $task, $udata, $exception) = @_;
-
- $conn->log("irspy_test", "bath search had error: $exception");
- my $rec = $conn->record();
- $rec->append_entry("irspy:status", "<irspy:search_bath ok='0'>" .
- isodate(time()) . "</irspy:search_bath>");
- zoom_error_timeout_update($conn, $exception);
- return ZOOM::IRSpy::Status::TASK_DONE;
-}
-
-
1;
1;