diff --git a/index.js b/index.js index 4285ab6..b3038fc 100644 --- a/index.js +++ b/index.js @@ -196,7 +196,6 @@ async function hookDataPostAsync(stream, plugin, connection) { } exports.hook_data_post = function (next, connection) { - const plugin = this; const txn = connection?.transaction; if (!txn) { @@ -204,12 +203,12 @@ exports.hook_data_post = function (next, connection) { } const stream = new PassThrough(); - hookDataPostAsync(stream, plugin, connection) + hookDataPostAsync(stream, this, connection) .then(() => { next(); }) .catch(err => { - plugin.logerror(err, plugin, connection); + this.logerror(err, this, connection); next(); });