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
787a3a6e
Commit
787a3a6e
authored
Jul 11, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If available capacity is below 0 it defaults to 0
parent
d16c3015
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
lib/gitlab/mirror.rb
lib/gitlab/mirror.rb
+8
-2
No files found.
lib/gitlab/mirror.rb
View file @
787a3a6e
...
...
@@ -28,9 +28,15 @@ module Gitlab
end
def
available_capacity
current_capacity
=
Gitlab
::
Redis
::
SharedState
.
with
{
|
redis
|
redis
.
scard
(
PULL_CAPACITY_KEY
)
}
current_capacity
=
Gitlab
::
Redis
::
SharedState
.
with
{
|
redis
|
redis
.
scard
(
PULL_CAPACITY_KEY
)
}
.
to_i
max_capacity
-
current_capacity
.
to_i
available
=
max_capacity
-
current_capacity
if
available
<
0
Rails
.
logger
.
info
(
"Mirror available capacity is below 0:
#{
available
}
"
)
available
=
0
end
available
end
def
increment_capacity
(
project_id
)
...
...
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