Commit fb08198b authored by Kamil Trzcinski's avatar Kamil Trzcinski

Rename shared_runners_minutes_quota? to shared_runners_minutes_limit_enabled?

parent a4ae95ad
......@@ -6,8 +6,8 @@ module EE
module Build
extend ActiveSupport::Concern
def shared_runners_minutes_quota?
runner && runner.shared? && project.shared_runners_minutes_quota?
def shared_runners_minutes_limit_enabled?
runner && runner.shared? && project.shared_runners_minutes_limit_enabled?
end
end
end
......@@ -10,14 +10,14 @@ module EE
delegate :shared_runners_minutes, :shared_runners_minutes_last_reset,
to: :project_metrics, allow_nil: true
delegate :shared_runners_minutes_limit_enabled?, :actual_shared_runners_minutes_limit,
delegate :actual_shared_runners_minutes_limit,
:shared_runners_minutes_used?, to: :namespace
has_one :project_metrics, dependent: :destroy
end
def shared_runners_minutes_quota?
!public? && shared_runners_enabled?
def shared_runners_minutes_limit_enabled?
!public? && shared_runners_enabled? && namespace.shared_runners_minutes_limit_enabled?
end
def shared_runners
......
class UpdateBuildMinutesService < BaseService
def execute(build)
return unless build.shared_runners_minutes_quota?
return unless build.shared_runners_minutes_limit_enabled?
return unless build.complete?
return unless build.duration
......
......@@ -4,11 +4,10 @@
%strong
- if project.shared_runners_enabled?
Enabled
- if project.shared_runners_minutes_quota?
- if project.shared_runners_minutes_limit_enabled?
- limit = project.actual_shared_runners_minutes_limit.to_i
(Limited to #{limit} minutes per month)
- else
(Unlimited minutes)
- if project.shared_runners_minutes_limit_enabled?
- limit = project.actual_shared_runners_minutes_limit.to_i
(Limited to #{limit} minutes per month)
- else
(Unlimited minutes)
- else
Disabled
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment