From be904a9b812af6819cc31bf1b2f44f6dc9a9a767 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 897fb224ae..eb3bfb2378 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Reporter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Reporter.pm @@ -131,7 +131,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); @@ -152,7 +154,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