Remove default arguments for common query context

This commit is contained in:
Pawel Chojnacki 2017-08-01 22:11:59 +02:00
parent feb94e8ea3
commit ba97a42193
2 changed files with 4 additions and 2 deletions

View file

@ -6,7 +6,9 @@ module Gitlab
def query(environment_id)
Environment.find_by(id: environment_id).try do |environment|
query_metrics(common_query_context(environment))
query_metrics(
common_query_context(environment, timeframe_start: 8.hours.ago.to_f, timeframe_end: Time.now.to_f)
)
end
end
end

View file

@ -71,7 +71,7 @@ module Gitlab
result.select { |group| group.metrics.any? }
end
def common_query_context(environment, timeframe_start: 8.hours.ago.to_f, timeframe_end: Time.now.to_f)
def common_query_context(environment, timeframe_start:, timeframe_end:)
{
timeframe_start: timeframe_start,
timeframe_end: timeframe_end,