diff options
Diffstat (limited to 'app/services/ci/create_pipeline_service.rb')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index 4106dfe0ecc..43a2f4e9a71 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -140,25 +140,24 @@ module Ci def build_logger Gitlab::Ci::Pipeline::Logger.new(project: project) do |l| l.log_when do |observations| - observations.any? do |name, values| - values.any? && + observations.any? do |name, observation| name.to_s.end_with?('duration_s') && - values.max >= LOG_MAX_DURATION_THRESHOLD + Array(observation).max >= LOG_MAX_DURATION_THRESHOLD end end l.log_when do |observations| - values = observations['pipeline_size_count'] - next false if values.empty? + count = observations['pipeline_size_count'] + next false unless count - values.max >= LOG_MAX_PIPELINE_SIZE + count >= LOG_MAX_PIPELINE_SIZE end l.log_when do |observations| - values = observations['pipeline_creation_duration_s'] - next false if values.empty? + duration = observations['pipeline_creation_duration_s'] + next false unless duration - values.max >= LOG_MAX_CREATION_THRESHOLD + duration >= LOG_MAX_CREATION_THRESHOLD end end end |