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
921f2248
Commit
921f2248
authored
Dec 15, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make limit to not be enabled if project is public
parent
bf5198ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
app/models/project.rb
app/models/project.rb
+5
-1
app/services/update_build_minutes_service.rb
app/services/update_build_minutes_service.rb
+2
-5
No files found.
app/models/project.rb
View file @
921f2248
...
...
@@ -29,7 +29,7 @@ class Project < ActiveRecord::Base
allow_nil:
true
delegate
:shared_runners_minutes
,
:shared_runners_minutes_limit
,
:shared_runners_minutes_used?
,
:shared_runners_minutes_limit_enabled?
,
:shared_runners_minutes_used?
,
to: :namespace
,
allow_nil:
true
default_value_for
:archived
,
false
...
...
@@ -1547,6 +1547,10 @@ class Project < ActiveRecord::Base
end
end
def
shared_runners_minutes_limit_enabled?
!
public
?
&&
namespace
.
shared_runners_minutes_limit_enabled?
end
private
# Check if a reference is being done cross-project
...
...
app/services/update_build_minutes_service.rb
View file @
921f2248
...
...
@@ -4,12 +4,9 @@ class UpdateBuildMinutesService < BaseService
return
unless
build
.
runner
.
shared?
return
unless
build
.
duration
return
unless
build
.
project
return
if
build
.
project
.
public
?
return
unless
build
.
project
.
shared_runners_minutes_limit_enabled
?
namespace
=
project
.
namespace
return
unless
namespace
namespace
.
find_or_create_project_metrics
.
project
.
namespace
.
find_or_create_namespace_metrics
.
update_all
(
'shared_runners_minutes = shared_runners_minutes + ?'
,
build
.
duration
)
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