Skip to content

Commit

Permalink
Fix possible 'span already finished' bug in plugin (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
oderayi authored Feb 7, 2020
1 parent 6c84b9a commit 2aff75c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
54 changes: 35 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/central-services-shared",
"version": "9.1.0",
"version": "9.1.1",
"description": "Shared code for central services",
"main": "src/index.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/util/hapi/plugins/eventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const onPreAuth = (request, reply) => {

const onPreResponse = async (request, reply) => {
const span = request.span
if (span && span.isFinished) {
return reply.continue
}
const response = request.response
if (span) {
if (response instanceof Error || response.isBoom) {
Expand Down

0 comments on commit 2aff75c

Please sign in to comment.