Clean prometheus dir only for master process

This commit is contained in:
Aleksei Lipniagov 2019-08-12 12:49:01 +03:00
parent debc497dbb
commit c90effd84a
1 changed files with 5 additions and 1 deletions

View File

@ -29,8 +29,12 @@ def cleanup_prometheus_multiproc_dir
end
end
def master_process?
Prometheus::PidProvider.worker_id.in? %w(unicorn_master puma_master)
end
warmup do |app|
cleanup_prometheus_multiproc_dir
cleanup_prometheus_multiproc_dir if master_process?
client = Rack::MockRequest.new(app)
client.get('/')