Process batches of items one at a time when marking them lost to avoid
sending too many parallel requests to the server.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
).result.then(function() {
return egCore.pcrud.retrieve('ccs', 4)
.then(function(resp) {
- var promises = [];
+ var promise = $q.when();
angular.forEach(copies, function(copy) {
- promises.push(service.mark_item(copy, resp, {}))
+ promise = promise.then(function() {
+ return service.mark_item(copy, resp, {});
+ });
});
- return $q.all(promises);
+ return promise;
});
});
}