From 1ca5e77fd94031ba9fb9b2465e94207c68d1956d Mon Sep 17 00:00:00 2001 From: Bruno Nocera Zanette <bnzanette@inf.ufpr.br> Date: Mon, 28 Sep 2015 20:03:01 -0300 Subject: [PATCH] Refactor code to use "all" instead of "all_ids" --- lib/tasks/thumbnail.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/thumbnail.rake b/lib/tasks/thumbnail.rake index d399bb4f0..3de4c7447 100644 --- a/lib/tasks/thumbnail.rake +++ b/lib/tasks/thumbnail.rake @@ -13,7 +13,7 @@ namespace :thumbnail do begin # Get items from dspace (from offset to offset+limit) - items_ids = item_database_repository.all_ids(limit,offset) + items = item_database_repository.all(limit,offset) rescue # Sleeps for a while to wait database's recovery sleep(30.seconds) @@ -21,13 +21,13 @@ namespace :thumbnail do next else # Terminate loop if there are no more items to import - break if items_ids.empty? + break if items.empty? # Increment offset, to get new items on next iteration offset = offset + limit - items_ids.each do |id| - ThumbnailGeneratorWorker.perform_async(id) + items.each do |item| + ThumbnailGeneratorWorker.perform_async(item.id) end end -- GitLab