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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
cc9468e4
Commit
cc9468e4
authored
Jun 06, 2018
by
Kim Carlbäcker
Committed by
Robert Speicher
Jun 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move GC/Repack to OptOut
parent
41eab9a9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/workers/git_garbage_collect_worker.rb
app/workers/git_garbage_collect_worker.rb
+3
-3
spec/workers/git_garbage_collect_worker_spec.rb
spec/workers/git_garbage_collect_worker_spec.rb
+1
-1
No files found.
app/workers/git_garbage_collect_worker.rb
View file @
cc9468e4
...
@@ -29,7 +29,7 @@ class GitGarbageCollectWorker
...
@@ -29,7 +29,7 @@ class GitGarbageCollectWorker
task
=
task
.
to_sym
task
=
task
.
to_sym
cmd
=
command
(
task
)
cmd
=
command
(
task
)
gitaly_migrate
(
GITALY_MIGRATED_TASKS
[
task
])
do
|
is_enabled
|
gitaly_migrate
(
GITALY_MIGRATED_TASKS
[
task
]
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
do
|
is_enabled
|
if
is_enabled
if
is_enabled
gitaly_call
(
task
,
project
.
repository
.
raw_repository
)
gitaly_call
(
task
,
project
.
repository
.
raw_repository
)
else
else
...
@@ -114,8 +114,8 @@ class GitGarbageCollectWorker
...
@@ -114,8 +114,8 @@ class GitGarbageCollectWorker
%W[git -c repack.writeBitmaps=
#{
config_value
}
]
%W[git -c repack.writeBitmaps=
#{
config_value
}
]
end
end
def
gitaly_migrate
(
method
,
&
block
)
def
gitaly_migrate
(
method
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_IN
,
&
block
)
Gitlab
::
GitalyClient
.
migrate
(
method
,
&
block
)
Gitlab
::
GitalyClient
.
migrate
(
method
,
status:
status
,
&
block
)
rescue
GRPC
::
NotFound
=>
e
rescue
GRPC
::
NotFound
=>
e
Gitlab
::
GitLogger
.
error
(
"
#{
method
}
failed:
\n
Repository not found"
)
Gitlab
::
GitLogger
.
error
(
"
#{
method
}
failed:
\n
Repository not found"
)
raise
Gitlab
::
Git
::
Repository
::
NoRepository
.
new
(
e
)
raise
Gitlab
::
Git
::
Repository
::
NoRepository
.
new
(
e
)
...
...
spec/workers/git_garbage_collect_worker_spec.rb
View file @
cc9468e4
...
@@ -104,7 +104,7 @@ describe GitGarbageCollectWorker do
...
@@ -104,7 +104,7 @@ describe GitGarbageCollectWorker do
it_should_behave_like
'flushing ref caches'
,
true
it_should_behave_like
'flushing ref caches'
,
true
end
end
context
"with Gitaly turned off"
,
:
skip_gitaly_mock
do
context
"with Gitaly turned off"
,
:
disable_gitaly
do
it_should_behave_like
'flushing ref caches'
,
false
it_should_behave_like
'flushing ref caches'
,
false
end
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