diff --git a/src/plugins/plugin-pg.ts b/src/plugins/plugin-pg.ts index 801605283..548dd4353 100644 --- a/src/plugins/plugin-pg.ts +++ b/src/plugins/plugin-pg.ts @@ -159,7 +159,7 @@ class PostgresPatchUtility { promise: Promise, span: Span ): Promise { - return (promise = promise.then( + return promise.then( res => { this.maybePopulateLabelsFromOutputs(span, null, res); span.endSpan(); @@ -170,7 +170,7 @@ class PostgresPatchUtility { span.endSpan(); throw err; } - )); + ); } } @@ -288,7 +288,7 @@ const plugin: Plugin = [ // Unlike in pg 6, the returned value can't be both a Promise and // a Submittable. So we don't run the risk of double-patching // here. - pgPatch.patchPromise(pgQuery, span); + pgQuery = pgPatch.patchPromise(pgQuery, span); } } return pgQuery;