Merge pull request #8 from marshall-lee/unsubscribe_when_exception

Unsubscribe notifier even when exception occurs
This commit is contained in:
Adrian Serafin 2015-06-29 20:11:22 +02:00
commit a672aa8537

View file

@ -16,10 +16,15 @@ module GrapeLogging
def after
stop_time
logger.info parameters
ActiveSupport::Notifications.unsubscribe(@subscription) if @subscription
nil
end
def call!(env)
super
ensure
ActiveSupport::Notifications.unsubscribe(@subscription) if @subscription
end
protected
def parameters
{