mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-04-27 14:57:40 +00:00
Unsubscribe notifier in ensure block
In case of unhandled exception we should unsubscribe notifier anyway. Related to #7.
This commit is contained in:
parent
3848b35b52
commit
28bb59e247
1 changed files with 6 additions and 1 deletions
|
|
@ -16,10 +16,15 @@ module GrapeLogging
|
||||||
def after
|
def after
|
||||||
stop_time
|
stop_time
|
||||||
logger.info parameters
|
logger.info parameters
|
||||||
ActiveSupport::Notifications.unsubscribe(@subscription) if @subscription
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def call!(env)
|
||||||
|
super
|
||||||
|
ensure
|
||||||
|
ActiveSupport::Notifications.unsubscribe(@subscription) if @subscription
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
def parameters
|
def parameters
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue