From 6ebd94ad349cc2ae70793c69ea06256be812fb5b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 1 Jun 2022 17:26:20 +0530 Subject: [PATCH] fix: skip hook log if condition is not matching re #2209 Signed-off-by: Pranav C --- .../nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts b/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts index dfdbdade0c..491f82d44b 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts @@ -291,10 +291,12 @@ export async function invokeWebhook( }; if (throwErrorOnFailure) throw e; } finally { - hookLog.execution_time = parseHrtimeToMilliSeconds( - process.hrtime(startTime) - ); - if (hookLog) HookLog.insert({ ...hookLog, test_call: !!testFilters }); + if (hookLog) { + hookLog.execution_time = parseHrtimeToMilliSeconds( + process.hrtime(startTime) + ); + HookLog.insert({ ...hookLog, test_call: !!testFilters }); + } } }