Created
June 15, 2016 15:57
-
-
Save stevelounsbury/0cb160b9e3b47b18383882206f9836e4 to your computer and use it in GitHub Desktop.
Unsubscribing ActiveJob::Logging::LogSubscriber
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def remove_aj_subscribers | |
| patterns = ActiveSupport::Subscriber.subscribers.detect { |s| s.is_a? ActiveJob::Logging::LogSubscriber }.patterns | |
| subscribers = patterns.map { |p| ActiveSupport::Notifications.notifier.listeners_for(p) }.flatten | |
| subscribers.each do |subscriber| | |
| ActiveSupport::Notifications.notifier.unsubscribe(subscriber) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment