From 7c6cda9a3d1979a6d85bb257490d8396c40e6017 Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Wed, 14 Mar 2018 18:34:31 -0400 Subject: [PATCH] LP#1756142 Stream the reporter "schedule" retrieve-by-folder response One of the options in the reporter when viewing future and past reports (aka a "schedule") is to retrieve "all", but this eventually results in a massive return value which clogs the OpenSRF pipes (or, rather, doesn't fit at all). Let's set this to stream the responses, which appears to work fine in the current reporter interface without any other changes. Signed-off-by: Dan Wells --- Open-ILS/src/perlmods/lib/OpenILS/Application/Reporter.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Reporter.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Reporter.pm index 81964ab3e1..7251df4767 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Reporter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Reporter.pm @@ -132,7 +132,9 @@ sub retrieve_folder_data { __PACKAGE__->register_method( api_name => 'open-ils.reporter.schedule.retrieve_by_folder', - method => 'retrieve_schedules'); + method => 'retrieve_schedules', + stream => 1 +); sub retrieve_schedules { my( $self, $conn, $auth, $folderId, $limit, $complete ) = @_; my $e = new_rstore_editor(authtoken=>$auth); @@ -153,7 +155,12 @@ sub retrieve_schedules { $query->[0]->{complete_time} = undef unless $complete; $query->[0]->{complete_time} = { '!=' => undef } if $complete; - return $e->search_reporter_schedule($query); + my $schedules = $e->search_reporter_schedule($query); + foreach my $schedule (@$schedules) { + $conn->respond($schedule); + } + + return undef; } __PACKAGE__->register_method( -- 2.11.0