Unsubscribe notifier in ensure block

In case of unhandled exception we should unsubscribe notifier anyway.
Related to #7.
This commit is contained in:
Vladimir Kochnev 2015-06-29 12:47:55 +03:00
parent 3848b35b52
commit 28bb59e247

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
{