From 4ccbf980e1f2eadf9f99e015e7ac3d4765d046f2 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 30 Jan 2015 11:43:46 -0500 Subject: [PATCH] LP#1402797 Hold Shefl: Use max_chunk_size to pass updates in a timely fashion; Notify on the correct array to allow paging back to work Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- .../src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 10 ++++++++-- Open-ILS/web/js/ui/default/staff/circ/holds/app.js | 7 ++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 5061f245ff..144098ede7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1687,6 +1687,7 @@ sub print_hold_pull_list_stream { delete($$params{chunk_size}) unless (int($$params{chunk_size})); delete($$params{chunk_size}) if ($$params{chunk_size} && $$params{chunk_size} > 50); # keep the size reasonable $$params{chunk_size} ||= 10; + $client->max_chunk_size($$params{chunk_size}); $$params{org_id} = (defined $$params{org_id}) ? $$params{org_id}: $e->requestor->ws_ou; return $e->die_event unless $e->allowed('VIEW_HOLD', $$params{org_id }); @@ -2225,6 +2226,7 @@ sub print_expired_holds_stream { delete($$params{chunk_size}) unless (int($$params{chunk_size})); delete($$params{chunk_size}) if ($$params{chunk_size} && $$params{chunk_size} > 50); # keep the size reasonable $$params{chunk_size} ||= 10; + $client->max_chunk_size($$params{chunk_size}); $$params{org_id} = (defined $$params{org_id}) ? $$params{org_id}: $e->requestor->ws_ou; @@ -3514,6 +3516,8 @@ sub clear_shelf_cache { return $e->die_event unless $e->checkauth and $e->allowed('VIEW_HOLD'); $chunk_size ||= 25; + $client->max_chunk_size($chunk_size); + my $hold_data = OpenSRF::Utils::Cache->new('global')->get_cache($cache_key); if (!$hold_data) { @@ -3603,7 +3607,7 @@ __PACKAGE__->register_method( ); sub clear_shelf_process { - my($self, $client, $auth, $org_id, $match_copy) = @_; + my($self, $client, $auth, $org_id, $match_copy, $chunk_size) = @_; my $e = new_editor(authtoken=>$auth); $e->checkauth or return $e->die_event; @@ -3622,7 +3626,9 @@ sub clear_shelf_process { my @holds; my @canceled_holds; # newly canceled holds - my $chunk_size = 25; # chunked status updates + $chunk_size ||= 25; # chunked status updates + $client->max_chunk_size($chunk_size); + my $counter = 0; for my $hold_id (@hold_ids) { diff --git a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js index 21e9ffc400..8ce83c4312 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js @@ -77,7 +77,7 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e // see if we have the requested range cached if (holds[offset]) { - return provider.arrayNotifier(patronSvc.holds, offset, count); + return provider.arrayNotifier(holds, offset, count); } // see if we have the holds IDs for this range already loaded @@ -173,7 +173,8 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e egCore.net.request( 'open-ils.circ', 'open-ils.circ.hold.clear_shelf.process', - egCore.auth.token(), $scope.pickup_ou.id() + egCore.auth.token(), $scope.pickup_ou.id(), + null, 1 // request responses from the clear shelf cache ).then( @@ -184,7 +185,7 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e egCore.net.request( 'open-ils.circ', 'open-ils.circ.hold.clear_shelf.get_cache', - egCore.auth.token(), resp.cache_key + egCore.auth.token(), resp.cache_key, 1 ).then(null, null, handle_clear_cache_resp); }, -- 2.43.2