Skip to content
Snippets Groups Projects
Commit 1ca5e77f authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Refactor code to use "all" instead of "all_ids"

parent c14a58b4
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment