From d39efedd25f367cbf3f02dab970b43f4bd942644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Hendricksen?= Date: Mon, 15 Aug 2016 15:26:21 -0400 Subject: [PATCH] try this for NR --- config.ru | 4 ++++ config/unicorn.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/config.ru b/config.ru index 3279bbae..4c46ac3a 100644 --- a/config.ru +++ b/config.ru @@ -15,4 +15,8 @@ skip = ['Travis::Memory', 'GH::ResponseWrapper', 'Travis::Helpers::Legacy', 'G target.load_constants! :only => only, :skip => skip, :debug => false end +require 'newrelic_rpm' +::NewRelic::Agent.manual_start() +::NewRelic::Agent.after_fork(:force_reconnect => true) + run Travis::Api::App.new diff --git a/config/unicorn.rb b/config/unicorn.rb index 463a017c..fc9d3fbb 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -6,6 +6,8 @@ timeout 30 # restarts workers that hang for 30 seconds tmp_dir = ENV.fetch("tmp_dir", "/tmp") listen File.expand_path("nginx.socket", tmp_dir), backlog: 1024 +preload_app true + require 'fileutils' before_fork do |server, worker| # preload travis so we can have copy on write