@instana/core
Advanced tools
Comparing version 1.82.0 to 1.82.1
{ | ||
"name": "@instana/core", | ||
"version": "1.82.0", | ||
"version": "1.82.1", | ||
"description": "Core library for Instana's Node.js packages", | ||
@@ -135,3 +135,3 @@ "main": "src/index.js", | ||
}, | ||
"gitHead": "9bf574487907275b677206de612b6a52c44d1651" | ||
"gitHead": "840a00e43e14574132698348273d4e9e77bbd400" | ||
} |
@@ -36,3 +36,4 @@ 'use strict'; | ||
// There is also an 'execute' method on the pool object but it uses the connection internally, so we do not need to | ||
// it. This is handled by the instrumented methods on Connection. We do need to instrument 'pool.query', though. | ||
// instrument it. This is handled by the instrumented methods on Connection. We do need to instrument 'pool.query', | ||
// though. | ||
shimmer.wrap(Pool, 'getConnection', shimGetConnection); | ||
@@ -172,10 +173,5 @@ } | ||
// no promise, continue with standard instrumentation | ||
var originalCallback = originalArgs[originalArgs.length - 1]; | ||
var hasCallback = false; | ||
if (typeof originalCallback === 'function') { | ||
originalCallback = cls.ns.bind(originalCallback); | ||
hasCallback = true; | ||
} | ||
var originalCallback; | ||
originalArgs[originalArgs.length - 1] = function onResult(error) { | ||
function onResult(error) { | ||
if (error) { | ||
@@ -190,7 +186,17 @@ span.ec = 1; | ||
if (hasCallback) { | ||
if (originalCallback) { | ||
return originalCallback.apply(this, arguments); | ||
} | ||
}; | ||
} | ||
if (typeof statementOrOpts._callback === 'function') { | ||
originalCallback = cls.ns.bind(statementOrOpts._callback); | ||
statementOrOpts._callback = onResult; | ||
} else { | ||
if (typeof originalArgs[originalArgs.length - 1] === 'function') { | ||
originalCallback = cls.ns.bind(originalArgs[originalArgs.length - 1]); | ||
} | ||
originalArgs[originalArgs.length - 1] = onResult; | ||
} | ||
return originalFunction.apply(ctx, originalArgs); | ||
@@ -201,3 +207,3 @@ }); | ||
function shimGetConnection(original) { | ||
return function(cb) { | ||
return function getConnection(cb) { | ||
return original.call(this, cls.ns.bind(cb)); | ||
@@ -204,0 +210,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
253744
7074