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
ebe9bd9c
Commit
ebe9bd9c
authored
May 10, 2018
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use progressbar with `geo:git:housekeeping:*`
parent
e82cf566
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
ee/lib/tasks/geo/git.rake
ee/lib/tasks/geo/git.rake
+3
-1
ee/spec/tasks/geo/git_rake_spec.rb
ee/spec/tasks/geo/git_rake_spec.rb
+1
-0
No files found.
ee/lib/tasks/geo/git.rake
View file @
ebe9bd9c
namespace
:geo
do
namespace
:geo
do
namespace
:git
do
namespace
:git
do
namespace
:housekeeping
do
namespace
:housekeeping
do
using
ProgressBar
::
Refinements
::
Enumerator
desc
"GitLab | Git | Housekeeping | Garbage Collection"
desc
"GitLab | Git | Housekeeping | Garbage Collection"
task
gc: :gitlab_environment
do
task
gc: :gitlab_environment
do
flag_for_housekeeping
(
Gitlab
::
CurrentSettings
.
housekeeping_gc_period
)
flag_for_housekeeping
(
Gitlab
::
CurrentSettings
.
housekeeping_gc_period
)
...
@@ -17,7 +19,7 @@ namespace :geo do
...
@@ -17,7 +19,7 @@ namespace :geo do
end
end
def
flag_for_housekeeping
(
period
)
def
flag_for_housekeeping
(
period
)
Geo
::
ProjectRegistry
.
select
(
:id
,
:project_id
).
find_in_batches
do
|
batches
|
Geo
::
ProjectRegistry
.
select
(
:id
,
:project_id
).
find_in_batches
.
with_progressbar
(
format:
'%t: |%B| %p%% %e'
)
do
|
batches
|
batches
.
each
do
|
registry
|
batches
.
each
do
|
registry
|
registry
.
set_syncs_since_gc!
(
period
-
1
)
registry
.
set_syncs_since_gc!
(
period
-
1
)
end
end
...
...
ee/spec/tasks/geo/git_rake_spec.rb
View file @
ebe9bd9c
...
@@ -14,6 +14,7 @@ describe 'geo:git:housekeeping' do
...
@@ -14,6 +14,7 @@ describe 'geo:git:housekeeping' do
before
do
before
do
Rake
.
application
.
rake_require
'tasks/geo/git'
Rake
.
application
.
rake_require
'tasks/geo/git'
silence_progress_bar
end
end
after
do
after
do
...
...
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