Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
debug(
'Timeline passed to plugins/ioredis.wrap not an instance of performance-node. Skipping.'
);
return false;
}
if (!Redis.__iopipeShimmer) {
if (process.env.IOPIPE_TRACE_IOREDIS_INITPROMISE) {
shimmer.wrap(
Redis.Command && Redis.Command.prototype,
'initPromise',
wrapPromise
);
}
shimmer.wrap(Redis && Redis.prototype, 'sendCommand', wrapSendCommand);
Redis.__iopipeShimmer = true;
}
return true;
function wrapPromise(original) {
return function wrappedPromise() {
const command = this;
const cb = this.callback;
const id = createId();
const { name } = command;
data[id] = {
name,
dbType: 'Redis',
request: filterRequest(command)
};
function wrap({ timeline, data = {} } = {}) {
if (!(timeline instanceof Perf)) {
debug(
'Timeline passed to plugins/ioredis.wrap not an instance of performance-node. Skipping.'
);
return false;
}
if (!Redis.__iopipeShimmer) {
if (process.env.IOPIPE_TRACE_IOREDIS_INITPROMISE) {
shimmer.wrap(
Redis.Command && Redis.Command.prototype,
'initPromise',
wrapPromise
);
}
shimmer.wrap(Redis && Redis.prototype, 'sendCommand', wrapSendCommand);
Redis.__iopipeShimmer = true;
}
return true;
function wrapPromise(original) {
return function wrappedPromise() {
const command = this;