Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
1ca5e77f
Commit
1ca5e77f
authored
9 years ago
by
Bruno Nocera Zanette
Browse files
Options
Downloads
Patches
Plain Diff
Refactor code to use "all" instead of "all_ids"
parent
c14a58b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/tasks/thumbnail.rake
+4
-4
4 additions, 4 deletions
lib/tasks/thumbnail.rake
with
4 additions
and
4 deletions
lib/tasks/thumbnail.rake
+
4
−
4
View file @
1ca5e77f
...
...
@@ -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
|
i
d
|
ThumbnailGeneratorWorker
.
perform_async
(
id
)
items
.
each
do
|
i
tem
|
ThumbnailGeneratorWorker
.
perform_async
(
item
.
id
)
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment