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

Add logic to check if thumbnail already exist

parent 5ada37ce
No related branches found
No related tags found
No related merge requests found
...@@ -25,13 +25,14 @@ namespace :thumbnail do ...@@ -25,13 +25,14 @@ namespace :thumbnail do
# Terminate loop if there are no more items to import # Terminate loop if there are no more items to import
break if items.empty? break if items.empty?
# Increment offset, to get new items on next iteration
offset = offset + limit
items.each do |item| items.each do |item|
ThumbnailGeneratorWorker.perform_async(item.id) if item.thumbnail.empty?
ThumbnailGeneratorWorker.perform_async(item.id)
end
end end
# Increment offset, to get new items on next iteration
offset += limit
end end
end end
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