Skip to content

Commit c90effd

Browse files
author
Aleksei Lipniagov
committed
Clean prometheus dir only for master process
1 parent debc497 commit c90effd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

config.ru

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ def cleanup_prometheus_multiproc_dir
2929
end
3030
end
3131

32+
def master_process?
33+
Prometheus::PidProvider.worker_id.in? %w(unicorn_master puma_master)
34+
end
35+
3236
warmup do |app|
33-
cleanup_prometheus_multiproc_dir
37+
cleanup_prometheus_multiproc_dir if master_process?
3438

3539
client = Rack::MockRequest.new(app)
3640
client.get('/')

0 commit comments

Comments
 (0)