BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2f0a2e99
Commit
2f0a2e99
authored
Mar 21, 2017
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dz-improve-rename-projects-migration' into 'master'
Improve rename projects migration Closes #29556 See merge request !10009
parents
f592cae1
ca0d8438
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
30 deletions
+1
-30
20170313133418_rename_more_reserved_project_names.rb
...rate/20170313133418_rename_more_reserved_project_names.rb
+1
-30
No files found.
db/post_migrate/20170313133418_rename_more_reserved_project_names.rb
View file @
2f0a2e99
...
...
@@ -6,41 +6,12 @@ class RenameMoreReservedProjectNames < ActiveRecord::Migration
DOWNTIME
=
false
THREAD_COUNT
=
8
KNOWN_PATHS
=
%w(artifacts graphs refs badges)
.
freeze
def
up
queues
=
Array
.
new
(
THREAD_COUNT
)
{
Queue
.
new
}
start
=
false
threads
=
Array
.
new
(
THREAD_COUNT
)
do
|
index
|
Thread
.
new
do
queue
=
queues
[
index
]
# Wait until we have input to process.
until
start
;
end
rename_projects
(
queue
.
pop
)
until
queue
.
empty?
end
end
enum
=
queues
.
each
reserved_projects
.
each_slice
(
100
)
do
|
slice
|
begin
queue
=
enum
.
next
rescue
StopIteration
enum
.
rewind
retry
end
queue
<<
slice
rename_projects
(
slice
)
end
start
=
true
threads
.
each
(
&
:join
)
end
def
down
...
...
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