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
4d92ca1f
Commit
4d92ca1f
authored
Mar 02, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code style fixes
parent
077e328a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
bin/elastic_repo_indexer
bin/elastic_repo_indexer
+1
-1
lib/elastic/indexer.rb
lib/elastic/indexer.rb
+8
-9
lib/gitlab/popen.rb
lib/gitlab/popen.rb
+1
-1
No files found.
bin/elastic_repo_indexer
View file @
4d92ca1f
...
...
@@ -41,7 +41,7 @@ Repository.__elasticsearch__.create_index!
repo
=
Repository
.
new
params
=
{
from_rev:
FROM_SHA
,
to_rev:
TO_SHA
}.
compact
params
=
{
from_rev:
FROM_SHA
,
to_rev:
TO_SHA
}.
compact
print
"Indexing commits..."
repo
.
index_commits
(
params
)
...
...
lib/elastic/indexer.rb
View file @
4d92ca1f
...
...
@@ -3,22 +3,21 @@ module Elastic
Error
=
Class
.
new
(
StandardError
)
def
initialize
connection_info
=
{
host:
Gitlab
.
config
.
elasticsearch
.
host
,
port:
Gitlab
.
config
.
elasticsearch
.
port
}.
to_json
# We accept any form of settings, including string and array
# This is why JSON is needed
@vars
=
{
'ELASTIC_CONNECTION_INFO'
=>
{
host:
Gitlab
.
config
.
elasticsearch
.
host
,
port:
Gitlab
.
config
.
elasticsearch
.
port
}.
to_json
,
'ELASTIC_CONNECTION_INFO'
=>
connection_info
,
'RAILS_ENV'
=>
Rails
.
env
}
end
def
run
(
project_id
,
repo_path
,
from_sha
=
nil
,
to_sha
=
nil
)
vars
=
@vars
.
merge
({
'FROM_SHA'
=>
from_sha
,
'TO_SHA'
=>
to_sha
})
def
run
(
project_id
,
repo_path
,
from_sha
=
nil
,
to_sha
=
nil
)
vars
=
@vars
.
merge
({
'FROM_SHA'
=>
from_sha
,
'TO_SHA'
=>
to_sha
})
command
=
[
'bin/elastic_repo_indexer'
,
project_id
.
to_s
,
repo_path
]
...
...
lib/gitlab/popen.rb
View file @
4d92ca1f
...
...
@@ -5,7 +5,7 @@ module Gitlab
module
Popen
extend
self
def
popen
(
cmd
,
path
=
nil
,
vars
=
{})
def
popen
(
cmd
,
path
=
nil
,
vars
=
{})
unless
cmd
.
is_a?
(
Array
)
raise
"System commands must be given as an array of strings"
end
...
...
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