Skip to content

Commit

Permalink
Merge pull request #7 from JSainsburyPLC/fix-nr-txn
Browse files Browse the repository at this point in the history
Only close NR transaction at the end of the request so error codes an…
  • Loading branch information
chrisjharding authored Nov 5, 2019
2 parents 9e0976e + 0cdf8ea commit 757b8f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func ContextMiddleware(
)

cc := NewContext(c, newRelicApp, logger, correlationID, isDebug, buildVersion)
defer cc.NewRelicTx.End()

return h(cc)
}
Expand All @@ -88,7 +89,6 @@ func NewContext(
echoCtx.Response().Writer,
echoCtx.Request(),
)
defer func() { _ = newRelicTx.End() }()
// new relic tx wraps response writer
echoCtx.Response().Writer = newRelicTx

Expand Down

0 comments on commit 757b8f1

Please sign in to comment.