Skip to content

Commit

Permalink
Call done() at inside of the active namespace context, fixes #701
Browse files Browse the repository at this point in the history
  • Loading branch information
iwaiktos committed Dec 18, 2024
1 parent 3b89008 commit 6aa0de0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk_contrib/fastify/lib/hooks/on-request.hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = function onRequestHook(request, reply, done) {

ns.run(() => {
AWSXRay.setSegment(segment);
done();
});
} else {
request.log.info('Manual mode, skipping segment');
Expand All @@ -25,7 +26,7 @@ module.exports = function onRequestHook(request, reply, done) {
} else {
request.log.warn('Request already has a segment, skipping');
}
}

done();
done();
}
};

0 comments on commit 6aa0de0

Please sign in to comment.