Exclude prometheus task for more rake tasks

This commit is contained in:
Sebastian Serth
2021-04-19 13:45:21 +02:00
parent 7972ce2546
commit 521a0cb710

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
return unless CodeOcean::Config.new(:code_ocean).read[:prometheus_exporter][:enabled]
return if Rake.application.top_level_tasks.to_s.include?('db:')
return if %w[db: assets:].any? { |task| Rake.application.top_level_tasks.to_s.include?(task) }
# Add metric callbacks to all models
ApplicationRecord.include Prometheus::Record