From 0a6dc1b7c0e37c6293b394efe993b47ffcc10b47 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Thu, 15 Mar 2018 10:37:31 -0700 Subject: [PATCH] LP#1754164: fix gateway timeout when retrieving many shelving locations A call to open-ils.circ.copy_location.retrieve.all via the gateway can fail with a large number of shelving locations. The API call succeeds, but the gateway reports a timeout and returns null. Streaming the response seems to fix the problem. Thanks to Dan Wells for providing an example to copy in LP#1756142. Signed-off-by: Jeff Davis --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CopyLocations.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CopyLocations.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CopyLocations.pm index 23061ca748..58f5bbf088 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CopyLocations.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CopyLocations.pm @@ -14,6 +14,7 @@ my $U = "OpenILS::Application::AppUtils"; __PACKAGE__->register_method( api_name => "open-ils.circ.copy_location.retrieve.all", method => 'cl_retrieve_all', + stream => 1, argc => 2, signature => q/ Retrieves the ranged set of copy locations for the requested org. @@ -39,10 +40,12 @@ sub cl_retrieve_all { $second_cstore_arg->{"flesh_fields"} = {"acpl" => ["owning_lib"]}; } - return new_editor()->search_asset_copy_location([{ + my $locations = new_editor()->search_asset_copy_location([{ owning_lib => $U->get_org_full_path($org_id), deleted => "f" }, $second_cstore_arg]); + $client->respond($_) for @$locations; + return undef; } __PACKAGE__->register_method( -- 2.11.0