Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove global cache

  • Loading branch information...
commit 644a1796c67ed4d55e2d2ae7182a6a020350f13c 1 parent e4de78a
@tenderlove tenderlove authored
Showing with 2 additions and 7 deletions.
  1. +2 −7 activesupport/lib/active_support/notifications.rb
View
9 activesupport/lib/active_support/notifications.rb
@@ -135,8 +135,6 @@ module ActiveSupport
# to log subscribers in a thread. You can use any queue implementation you want.
#
module Notifications
- @instrumenters = Hash.new { |h,k| h[k] = notifier.listening?(k) }
-
class Registry # :nodoc:
def self.instance
Thread.current[name] ||= new
@@ -160,7 +158,7 @@ def publish(name, *args)
end
def instrument(name, payload = {})
- if @instrumenters[name]
+ if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
@@ -168,9 +166,7 @@ def instrument(name, payload = {})
end
def subscribe(*args, &block)
- notifier.subscribe(*args, &block).tap do
- @instrumenters.clear
- end
+ notifier.subscribe(*args, &block)
end
def subscribed(callback, *args, &block)
@@ -182,7 +178,6 @@ def subscribed(callback, *args, &block)
def unsubscribe(args)
notifier.unsubscribe(args)
- @instrumenters.clear
end
def instrumenter
Please sign in to comment.
Something went wrong with that request. Please try again.