[open-ils-commits] [GIT] Evergreen ILS branch master updated. 044c42dd1deefe387181ea4810d3d6b597ff24ad

Evergreen Git git at git.evergreen-ils.org
Sun Feb 18 10:56:12 EST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  044c42dd1deefe387181ea4810d3d6b597ff24ad (commit)
       via  b90b6eaca8ac1a23101cdd9f2752058408bc9a22 (commit)
      from  fff3d40e087b78f00e9d67dbdf84c7c26911c438 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 044c42dd1deefe387181ea4810d3d6b597ff24ad
Author: Bill Erickson <berickxx at gmail.com>
Date:   Fri Jan 26 16:42:08 2018 -0500

    LP#1745499 De-Parallelify Item Status file upload
    
    Fetch copies in a series instead of in parallel when loading copy
    barcodes from a file in the Item Status interface.  This helps avoid
    excessive pcrud process count.
    
    Since this causes the action to take a little longer, the commit also
    includes a progress dialog indicating copy retrieve progress.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js
index e587818..be8e797 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js
@@ -234,8 +234,13 @@ function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc)
  * List view - grid stuff
  */
 .controller('ListCtrl', 
-       ['$scope','$q','$routeParams','$location','$timeout','$window','egCore','egGridDataProvider','egItem','egUser','$uibModal','egCirc','egConfirmDialog',
-function($scope , $q , $routeParams , $location , $timeout , $window , egCore , egGridDataProvider , itemSvc , egUser , $uibModal , egCirc , egConfirmDialog) {
+       ['$scope','$q','$routeParams','$location','$timeout','$window','egCore',
+        'egGridDataProvider','egItem','egUser','$uibModal','egCirc','egConfirmDialog',
+        'egProgressDialog',
+function($scope , $q , $routeParams , $location , $timeout , $window , egCore , 
+         egGridDataProvider , itemSvc , egUser , $uibModal , egCirc , egConfirmDialog,
+         egProgressDialog) {
+
     var copyId = [];
     var cp_list = $routeParams.idList;
     if (cp_list) {
@@ -282,18 +287,24 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
                 barcodes.push(line);
             });
 
-            if (barcodes.length > 0) {
-                var promises = [];
-                angular.forEach(barcodes, function (b) {
-                    promises.push(itemSvc.fetch(b));
-                });
+            // Serialize copy retrieval since there may be many, many copies.
+            function fetch_next_copy() {
+                var barcode = barcodes.pop();
+                egProgressDialog.increment();
 
-                $q.all(promises).then(
-                    function() {
-                        copyGrid.refresh();
-                        copyGrid.selectItems([itemSvc.copies[0].index]);
-                    }
-                );
+                if (!barcode) { // All done here.
+                    egProgressDialog.close();
+                    copyGrid.refresh();
+                    copyGrid.selectItems([itemSvc.copies[0].index]);
+                    return;
+                }
+
+                itemSvc.fetch(barcode).then(fetch_next_copy);
+            }
+
+            if (barcodes.length) {
+                egProgressDialog.open({value: 0, max: barcodes.length});
+                fetch_next_copy();
             }
         }
     });

commit b90b6eaca8ac1a23101cdd9f2752058408bc9a22
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Jan 25 17:57:32 2018 -0500

    LP#1745499 Patron bucket from file query consolidation
    
    Replace one-pcrud-call-per-barcode with a single (streaming) pcrud
    search call to fetch patron cards when using the barcode file upload
    option in the web staff pending patron bucket UI.  This avoids spawning
    high number of pcrud processes.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js
index 4c3e5cc..70025b5 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js
@@ -220,24 +220,28 @@ function($scope,  $routeParams,  bucketSvc , egGridDataProvider,   egCore , ngTo
 
     $scope.$watch('barcodesFromFile', function(newVal, oldVal) {
         if (newVal && newVal != oldVal) {
-            var promises = [];
+            var barcodes = [];
             // $scope.resetPendingList(); // ??? Add instead of replace
             angular.forEach(newVal.split(/\n/), function(line) {
                 if (!line) return;
                 // scrub any trailing spaces or commas from the barcode
                 line = line.replace(/(.*?)($|\s.*|,.*)/,'$1');
-                promises.push(egCore.pcrud.search(
-                    'ac',
-                    {barcode : line},
-                    {}
-                ).then(null, null, function(card) {
-                    bucketSvc.pendingList.push(card.usr());
-                }));
-            });
+                barcodes.push(line);
 
-            $q.all(promises).then(function () {
-                $scope.gridControls.setQuery({id : bucketSvc.pendingList});
             });
+            egCore.pcrud.search(
+                'ac',
+                {barcode : barcodes},
+                {}
+            ).then(
+                function() {
+                    $scope.gridControls.setQuery({id : bucketSvc.pendingList});
+                },
+                null, 
+                function(card) {
+                    bucketSvc.pendingList.push(card.usr());
+                }
+            );
         }
     });
 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/staff/cat/item/app.js   |   39 +++++++++++++-------
 .../js/ui/default/staff/circ/patron/bucket/app.js  |   26 ++++++++------
 2 files changed, 40 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list