Skip to content

Commit

Permalink
Update packages/autometrics/src/wrappers.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Arend van Beelen jr. <[email protected]>
  • Loading branch information
keturiosakys and arendjr authored Oct 25, 2023
1 parent 23085c2 commit e5fffc8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/autometrics/src/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,9 @@ export function autometrics<F extends FunctionSig>(
module: moduleName,
});

let callerFunction: string;
let callerModule: string;

const callerData = asyncLocalStorage?.getStore() ?? "";

if (callerData !== "") {
callerFunction = callerData.callerFunction ?? "";
callerModule = callerData.callerModule ?? "";
}
const callerData = asyncLocalStorage?.getStore();
const callerFunction = callerData?.callerFunction ?? "";
const callerModule = callerData?.callerModule ?? "";

const onSuccess = () => {
const autometricsDuration = (performance.now() - autometricsStart) / 1000;
Expand Down

0 comments on commit e5fffc8

Please sign in to comment.