From acbfb8e2f30029148ffeec4a49803c01eb9640f7 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 }); + } } }