Skip to content

Instantly share code, notes, and snippets.

@gnarg
Created September 30, 2012 04:32
Show Gist options
  • Select an option

  • Save gnarg/3805839 to your computer and use it in GitHub Desktop.

Select an option

Save gnarg/3805839 to your computer and use it in GitHub Desktop.
thread cleanup for webrick
module NewRelic::Agent::StatsEngine::Transactions
alias_method :end_transaction, :end_transaction_without_thread_local_cleanup
def end_transaction_with_thread_local_cleanup
end_transaction_without_thread_local_cleanup
Thread.current.keys.each do |key|
Thread.current[key] = nil
end
end
alias_method :end_transaction_with_thread_local_cleanup, :end_transaction
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment