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
97d44c2c
Commit
97d44c2c
authored
Jun 23, 2020
by
Markus Koller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Access Repository#shard directly
parent
687ff73d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
app/services/repositories/base_service.rb
app/services/repositories/base_service.rb
+2
-3
app/services/repositories/shell_destroy_service.rb
app/services/repositories/shell_destroy_service.rb
+1
-1
lib/api/helpers/internal_helpers.rb
lib/api/helpers/internal_helpers.rb
+2
-2
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+2
-2
No files found.
app/services/repositories/base_service.rb
View file @
97d44c2c
...
...
@@ -8,20 +8,19 @@ class Repositories::BaseService < BaseService
attr_reader
:repository
delegate
:container
,
:disk_path
,
:full_path
,
to: :repository
delegate
:repository_storage
,
to: :container
def
initialize
(
repository
)
@repository
=
repository
end
def
repo_exists?
(
path
)
gitlab_shell
.
repository_exists?
(
repository
_storage
,
path
+
'.git'
)
gitlab_shell
.
repository_exists?
(
repository
.
shard
,
path
+
'.git'
)
end
def
mv_repository
(
from_path
,
to_path
)
return
true
unless
repo_exists?
(
from_path
)
gitlab_shell
.
mv_repository
(
repository
_storage
,
from_path
,
to_path
)
gitlab_shell
.
mv_repository
(
repository
.
shard
,
from_path
,
to_path
)
end
# Build a path for removing repositories
...
...
app/services/repositories/shell_destroy_service.rb
View file @
97d44c2c
...
...
@@ -9,7 +9,7 @@ class Repositories::ShellDestroyService < Repositories::BaseService
GitlabShellWorker
.
perform_in
(
delay
,
:remove_repository
,
repository
_storage
,
repository
.
shard
,
removal_path
)
end
end
lib/api/helpers/internal_helpers.rb
View file @
97d44c2c
...
...
@@ -118,8 +118,8 @@ module API
{
repository:
repository
.
gitaly_repository
,
address:
Gitlab
::
GitalyClient
.
address
(
container
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
container
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
repository
.
shard
),
token:
Gitlab
::
GitalyClient
.
token
(
repository
.
shard
),
features:
Feature
::
Gitaly
.
server_feature_flags
}
end
...
...
lib/gitlab/workhorse.rb
View file @
97d44c2c
...
...
@@ -216,8 +216,8 @@ module Gitlab
def
gitaly_server_hash
(
repository
)
{
address:
Gitlab
::
GitalyClient
.
address
(
repository
.
container
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
repository
.
container
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
repository
.
shard
),
token:
Gitlab
::
GitalyClient
.
token
(
repository
.
shard
),
features:
Feature
::
Gitaly
.
server_feature_flags
}
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