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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
2c6fe722
Commit
2c6fe722
authored
8 years ago
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix thread join issue
parent
6d09e946
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
db/migrate/20160620110927_fix_no_validatable_import_url.rb
db/migrate/20160620110927_fix_no_validatable_import_url.rb
+2
-4
No files found.
db/migrate/20160620110927_fix_no_validatable_import_url.rb
View file @
2c6fe722
...
...
@@ -68,7 +68,6 @@ class FixNoValidatableImportUrl < ActiveRecord::Migration
end
def
process_invalid_import_urls
@threads
=
[]
batches
=
SqlBatches
.
new
(
query:
"SELECT id, import_url FROM projects WHERE import_url IS NOT NULL"
)
while
batches
.
next?
...
...
@@ -81,17 +80,16 @@ class FixNoValidatableImportUrl < ActiveRecord::Migration
process_batch
(
project_ids
)
end
@threads
.
each
(
&
:join
)
end
def
process_batch
(
project_ids
)
@threads
<<
Thread
.
new
do
Thread
.
new
do
begin
project_ids
.
each
{
|
project_id
|
cleanup_import_url
(
project_id
)
}
ensure
ActiveRecord
::
Base
.
connection
.
close
end
end
end
.
join
end
def
valid_url?
(
url
)
...
...
This diff is collapsed.
Click to expand it.
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