Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
233f4fb9
Commit
233f4fb9
authored
Apr 05, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interleave downloads to not prioritize certain files over the other
parent
1db1dfa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
app/workers/geo_file_download_dispatch_worker.rb
app/workers/geo_file_download_dispatch_worker.rb
+10
-2
No files found.
app/workers/geo_file_download_dispatch_worker.rb
View file @
233f4fb9
...
...
@@ -63,9 +63,17 @@ class GeoFileDownloadDispatchWorker
def
load_pending_downloads
lfs_object_ids
=
find_lfs_object_ids
(
DB_RETRIEVE_BATCH
)
objects_ids
=
find_object_ids
(
DB_RETRIEVE_BATCH
-
lfs_object_ids
.
size
)
objects_ids
=
find_object_ids
(
DB_RETRIEVE_BATCH
)
@pending_downloads
=
lfs_object_ids
+
objects_ids
@pending_downloads
=
interleave
(
lfs_object_ids
,
objects_ids
)
end
def
interleave
(
first
,
second
)
if
first
.
length
>=
second
.
length
first
.
zip
(
second
)
else
second
.
zip
(
first
).
map
(
&
:reverse
)
end
.
flatten
(
1
).
compact
.
take
(
DB_RETRIEVE_BATCH
)
end
def
downloads_remain?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment